Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

How can I hook the filesystem?

Thread view: 
lightning - 23 May 2007 05:43 GMT
Like tomcat,when I put a war into the webapps directory,it starts to
unzip it.
How did it do that??
linbo - 23 May 2007 09:45 GMT
> 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
lightning - 23 May 2007 10:56 GMT
> > Like tomcat,when I put a war into the webapps directory,it starts to
> > unzip it.
[quoted text clipped - 5 lines]
> Cheers,
> Bo

Wow,thx for your knowledge!So the tomcat is!
Just a timertask....I thought it may cost too much,but it is a simple
nice solution.
Like many other situations which need "interruption mechanism" but do
not have it,en,just build a new thread to handle these...
What else needs paying attention to if I do this?
lightning - 23 May 2007 10:56 GMT
> > Like tomcat,when I put a war into the webapps directory,it starts to
> > unzip it.
[quoted text clipped - 5 lines]
> Cheers,
> Bo

Wow,thx for your knowledge!So the tomcat is!
Just a timertask....I thought it may cost too much,but it is a simple
nice solution.
Like many other situations which need "interruption mechanism" but do
not have it,en,just build a new thread to handle these...
What else needs paying attention to if I do this?
lightning - 23 May 2007 10:56 GMT
> > Like tomcat,when I put a war into the webapps directory,it starts to
> > unzip it.
[quoted text clipped - 5 lines]
> Cheers,
> Bo

Wow,thx for your knowledge!So the tomcat is!
Just a timertask....I thought it may cost too much,but it is a simple
nice solution.
Like many other situations which need "interruption mechanism" but do
not have it,en,just build a new thread to handle these...
What else needs paying attention to if I do this?
lightning - 23 May 2007 10:56 GMT
> > Like tomcat,when I put a war into the webapps directory,it starts to
> > unzip it.
[quoted text clipped - 5 lines]
> Cheers,
> Bo

Wow,thx for your knowledge!So the tomcat is!
Just a timertask....I thought it may cost too much,but it is a simple
nice solution.
Like many other situations which need "interruption mechanism" but do
not have it,en,just build a new thread to handle these...
What else needs paying attention to if I do this?
lightning - 23 May 2007 10:57 GMT
> > Like tomcat,when I put a war into the webapps directory,it starts to
> > unzip it.
[quoted text clipped - 5 lines]
> Cheers,
> Bo

Wow,thx for your knowledge!So the tomcat is!
Just a timertask....I thought it may cost too much,but it is a simple
nice solution.
Like many other situations which need "interruption mechanism" but do
not have it,en,just build a new thread to handle these...
What else needs paying attention to if I do this?
lightning - 23 May 2007 10:57 GMT
Wow,thx for your knowledge!So the tomcat is!
Just a timertask....I thought it may cost too much,but it is a simple
nice solution.
Like many other situations which need "interruption mechanism" but do
not have it,en,just build a new thread to handle these...
What else needs paying attention to if I do this?
lightning - 23 May 2007 10:57 GMT
Wow,thx for your knowledge!So the tomcat is!
Just a timertask....I thought it may cost too much,but it is a simple
nice solution.
Like many other situations which need "interruption mechanism" but do
not have it,en,just build a new thread to handle these...
What else needs paying attention to if I do this?
lightning - 23 May 2007 10:57 GMT
Wow,thx for your knowledge!So the tomcat is!
Just a timertask....I thought it may cost too much,but it is a simple
nice solution.
Like many other situations which need "interruption mechanism" but do
not have it,en,just build a new thread to handle these...
What else needs paying attention to if I do this?
lightning - 23 May 2007 10:57 GMT
Wow,thx for your knowledge!So the tomcat is!
Just a timertask....I thought it may cost too much,but it is a simple
nice solution.
Like many other situations which need "interruption mechanism" but do
not have it,en,just build a new thread to handle these...
What else needs paying attention to if I do this?
Philipp Leitner - 23 May 2007 10:55 GMT
> 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
lightning - 23 May 2007 11:07 GMT
> > Like tomcat,when I put a war into the webapps directory,it starts to
> > unzip it.
[quoted text clipped - 12 lines]
>
> /philipp

well,I thought tomcat used jni,but it does not, :)

Yeah,linux , win or solaris all have some function to hook the file
system.
lightning - 23 May 2007 11:07 GMT
> > Like tomcat,when I put a war into the webapps directory,it starts to
> > unzip it.
[quoted text clipped - 12 lines]
>
> /philipp

well,I thought tomcat used jni,but it does not, :)

Yeah,linux , win or solaris all have some function to hook the file
system.
Roedy Green - 28 May 2007 11:16 GMT
>Like tomcat,when I put a war into the webapps directory,it starts to
>unzip it.
>How did it do that??

see http://mindprod.com/jgloss/filemonitor.html
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.