Why would obtaining a RandomAccessFile(path.toFile(),"rw")
produce a FileNotFoundException
from a Path
that was returned from WatchService
and the WatchEvent
kind is ENTRY_CREATE
?
java.io.FileNotFoundException:
C:\SharedFolders\FromS01\SSLServer01\SSLInternal02\DOMAIN\EML\E6046292.723
(The process cannot access the file because it is being used by another process)
at java.io.RandomAccessFile.open(Native Method) ~[na:1.8.0-ea]
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:236) ~[na:1.8.0-ea]
at cbbb.filejobs.Main.fileCopied(Main.java:446) ~[CbbbFileJobs.jar:na]
at cbbb.filejobs.Main.processFilesPending(Main.java:409) ~[CbbbFileJobs.jar:na]
at cbbb.filejobs.Main.handleFileTasks(Main.java:156) ~[CbbbFileJobs.jar:na]