0

I have a situation, where I have created new Folder 'XYZ' and I am copying huge files to 'XYZ' folder. I need a condition check whether the copying files to 'XYZ' folder is completed or not, before I begin my process on 'XYZ' folder.

Thanks

  • 2
    That depends on how you're copying. Please post the code. – ernest_k Mar 22 '18 at 09:41
  • 1
    `if (!stillCopying()) { beginYourProcess() }` ... this is the answer of the same level of detail and clarity as your question. Please take the time to ask a proper question if you want people to help you – Ovidiu Dolha Mar 22 '18 at 09:43
  • Possible duplicate of [How to tell when a File is "Done" copying into a watched Directory?](https://stackoverflow.com/questions/17933557/how-to-tell-when-a-file-is-done-copying-into-a-watched-directory) – Stefan Freitag Mar 22 '18 at 09:45
  • Copying the files manually to 'XYZ' folder. – Hanumanth Reddy Mar 22 '18 at 09:48
  • @HanumanthReddy what do you mean by manually ? Like drag and drop ? – vincrichaud Mar 22 '18 at 09:56
  • @ vincrichaud, Yes like drag and drop. – Hanumanth Reddy Mar 22 '18 at 10:08
  • Please edit your question - your are copying file manually and you want to know the status in java code whether it is copied or not, please do draft question properly to help you out – Afgan Mar 22 '18 at 10:13
  • @Afgan, my question is correct only. The other team will be doing the copy mechanism, and I am making the process automation from there. – Hanumanth Reddy Mar 22 '18 at 10:22
  • First, we get its current file size. and we will wait for 200ms(can be less or more) and check for the size again. If the size differs, we will retry for 5 times. Only when the file size stops growing, the File will be marked as COMPLETED.(i.e. return true). hope you know the file name – Afgan Mar 22 '18 at 10:33

0 Answers0