commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Toennsen" <>
Subject How to use a org.apache.commons.vfs.FileListener
Date Fri, 11 Jul 2008 15:03:44 GMT
Hi Everybody,

I am completely new to the commons.vfs package and don't really know how to start. A part
of the Program I am writing at the moment has to Listen to a Folder in the Local FileSystem
(can be Unix, Mac or Windows). The Idea was to implement a kind of a Listener, which is called
if a new File or Folder in the specific Directory is added, a File or folder is removed or
a File is modified. During my research I found the org.apache.commons.vfs package, which seems
to provide the functionality I need. I guess I have to implement the FileListener Interface
and add it to the folder which should be observed and to all other subdirectories as well.

The Problem I have is the following: How do I have to use these Package? I didn't find some
examples and the Informations in the API is quite short as well (sorry but I am too stupid
to find the Informations I need). The first problem I have is how do I have to initialize
this thing? What does the FileProvider or FileSystemManager? How do I create the FileSystem
to add the listener to? Or is a VirtualFileSystem enought for my case? Do I have to use A
FileObject to create the FileSystem or does the Manager have to do the job? (both have methods
to create a FileSystem)
I tried to put some Components together but it was kind of random guessing, because I don't
really understood which component is responsible for what parts of work. 

Can you help me please and give me a short example of a setup? Or is there a tutorial which
I didn't found? 
I know I am asking dummy questions but I really hope that you help me or at least give a hint.
Thanks a million and best regards

GMX Kostenlose Spiele: Einfach online spielen und SpaƟ haben mit Pastry Passion!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message