commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [VFS] FileSelector
Date Fri, 16 Sep 2005 05:37:55 GMT
Hi!
> 1.
> In my FileSelector imp. i check for new files in a dir to upload to a 
> server. If there are no new files (boolean includeFile returns false 
> every time) the connection id still made to the server? Is that 
> nessesary?
I guess you use FileObject.copyFrom(), do you?
Then yes, this connection is needed as VFS checks if the destination 
exists and is writeable.
> 2.
> Now... when my app is running and i put a new file in the dir that is 
> being checked, it seems like the new file is ignored. boolean 
> includeFile is not called with the new file? In the check loop i even 
> make new:
>             fileOUT = fsManager.resolveFile(backupFolderPath, opts);
You have to call "fileOUT.close()" which will reset the cache, you still 
can use fileOUT for subsequent operations.

But maybe take a look at org.apache.commons.vfs.impl.DefaultFileMonitor.
Using a fileListener you will get informed as soon as something has 
changed is the directory you monitor.

Ciao,
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message