Maybe you can solve this within your LockManager.
When looking at the code you could do some workaround for it.
String uri =
file.toURI().relativize(aFile.toURI()).toString();
Lock lock = lockManager.getLock(uri);
if (lock.tryLock()) {
processFileNow(aFile);
} ....
Now imagine in the tryLock() method you have some check logic that
determines the fileSize, wait some millis and again determine the fileSize.
Now compare the 2 sizes and if not equal than the copying is most likely not
finished yet and you should return false, otherwise return true.
Anyway you are free to raise a JIRA for this.
Regards
Lars
2008/11/26 Char <[EMAIL PROTECTED]>
>
> Hello servicemix-community!
>
> I have a jbi:file-poller component that has to poll large files (30MB).
> Sometimes, i get a FileNotFoundException, because the poller tries to read
> the file before the copy-task has finished.
>
> I tried to solve this by implementing my own LockManager, which tries to
> check before whether the file is now ready to be read or not. But
> unfortunately, this doesn't work well...
>
> So, what is the common workaround here?
>
> thanks for your help
>
> charx
> --
> View this message in context:
> http://www.nabble.com/Polling-very-large-files-tp20701486p20701486.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
--
http://lhein.blogspot.com