In our requirement, we have an empty directory, when we drop a file in that directory, we need to read that file according to the API (that I have implemented and tested in standalone). How to load that file as soon as drop that into that directoru, and need to wait that listener till the complete file droped. how can we implement that code?
Check out Apache Commons VFS, especially its FileMonitor interface and DefaultFileMonitor implementation. Although that does not notify you immediately, it's polling each second so you get notified within a second.
If you need actual direct notification you may be able to use JNI to connect to the file system, but a) this is a lot more complex, and b) it's file system dependant (FAT32 would probably need to have different code than NTFS and EXT2/EXT3).