I have to implement synchronization between the Java application and the shell script. Is it possible?
You can do implicit things, like: the Java application puts a marker file like processing-files-now.txt into the destination directory. Just for better debugging, that file might contain the number of files that are currently processed.
When the Java application is done processing, it can come in and delete that marker file.
Then the script could check for the presence of that file (in order to not start transmitting files while the java application adds new files).
On the other hand, the real problem might be: the java application starts while the script is transferring files. If you really want to avoid that, you could have the script write such a file, too.
But note that such "file system based" synchronisation isn't too robust, and might give you all kinds of trouble over time.
This really depends on "scale". For a small setup, where there is a low chance of serious trouble, or even no terrible for consequences when the two programs work in parallel ... the above might do.
But in a more real world scenario, you should do such things differently.