I am recently working on a Java desktop application which needs to track a path of file which has been recently moved to somewhere in native file system from the known source.
For Example : - Let's suppose i have a file A.txt in %TEMP% folder (C:\Users\Admin\AppData\Local\Temp\A.txt). Now Operating system moves that file to, suppose my Desktop. So i suppose to get the path "C:\Users\Admin\Desktop\A.txt".
How can I get the destination path, that's unknown, of recently moved file from known source?
Please Note:
- We can search the file name on Native file system but it makes the process slow and time consuming. Is there any fast searching code OR JAR, that would be a open source, available which can make a fast search without consuming time.
- Can we some who communicate with Operating system which can either give us the path of recently moved file OR we can access i开发者_StackOverflow社区ts logs Or etc..etc.
- It must work with Linux, MAC and Windows.
So finally we need the absolute path of just moved file to somewhere in native file system from known folder.
You could watch the original location with jnotify. This library work with linux, windows and OSX. It calls you on the move events.
精彩评论