0

While implementing a "sFTP --mv--> sFTP" program I use WatchService from the java.nio lib to register StandardWatchEventKinds.ENTRY_CREATE. The use case is, that some device drops a file onto a Server in a DMZ, which I'd like to move to another FTP Server in my Domain.

The file transmission onto the first server can take some moments. How can I safely move the file to the 2nd server, because I don't know when the creation process is complete and the file is able to be moved? Is Entry_create the wrong Event to be listened to?

Semo
  • 783
  • 2
  • 17
  • 38
  • 2
    A related question: https://stackoverflow.com/questions/22956262/java-watchservice-gets-informed-before-content-is-copied. Also look at the questions linked to that question, and the questions linked to _those_ questions, and so on. – Slaw Oct 02 '19 at 15:05
  • Great. Thank you very much – Semo Oct 02 '19 at 16:57

0 Answers0