My application saves excel file data in a database (mongodb
) using java
.
On user click my application will do
- First create an excel file on local
filesystem
for instanceC:\ali.xlsx
and place data on excel file . - Open excel file
C:\ali.xlsx
usingjava.awt.Desktop
classopen
method for thecross platform
perspective. When user close file
C:\ali.xlsx
gets its close event so that i will get file updated value and save it to thedatabase
.Delete the file
C:\ali.xlsx
from the localfilesystem
.
My Question :
How to implement the third bullet point.
In short : how to get close
event of any file using java
.
If anyone have another approach to implement this functionality please tell me also that's why I write the application flow .