How can I hook the filesystem?

L

lightning

Like tomcat,when I put a war into the webapps directory,it starts to
unzip it.
How did it do that??
 
L

linbo

lightning said:
Like tomcat,when I put a war into the webapps directory,it starts to
unzip it.
How did it do that??

I'm not aware of any way to 'hook' into the filesystem, by Tomcat does it by
having a background thread check the webapps directory every few seconds.

Cheers,
Bo
 
P

Philipp Leitner

Like tomcat,when I put a war into the webapps directory,it starts to
unzip it.
How did it do that??

To 'hook' the filesystem you would need a OS kernel extension that
actually /tells/ the application when the FS has changed. There's
something like that for Linux (for instance Beagle uses this kernel
extension) and most probably also for other OS, but that solution
would be highly operation system specific, and you would probably need
JNI to use it at all (guess there's no Java bindings).

If you are just interested in one single directory the much simpler
solution is to have a watcher thread (perhaps a Timer Task) checking
the directory contents periodically.

/philipp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top