How to monitor a folder ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How to monitor a folder ?

neuron005
Hi

I want to run a script which keeps monitoring a folder. If an object(image/video) is put into it , try to copy it to another location and other operations. How can I do that in my grails application. Ho to check if something new is added to the folder and what is it ? This is urgent. If anyone has solution, please provide .


Thanks
Reply | Threaded
Open this post in threaded view
|

Re: How to monitor a folder ?

lucastex
If you're in Java 7, you can use Watch Services.


[]s,





On Sat, Oct 6, 2012 at 3:55 PM, neuron005 <[hidden email]> wrote:
Hi

I want to run a script which keeps monitoring a folder. If an
object(image/video) is put into it , try to copy it to another location and
other operations. How can I do that in my grails application. Ho to check if
something new is added to the folder and what is it ? This is urgent. If
anyone has solution, please provide .


Thanks




--
View this message in context: http://grails.1312388.n4.nabble.com/How-to-monitor-a-folder-tp4635968.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: How to monitor a folder ?

bksaville
If you find a solution, please send it back to the list - I'm very interested in this functionality too (in Java 6).

-Brian

On Sat, Oct 6, 2012 at 1:00 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
If you're in Java 7, you can use Watch Services.


[]s,





On Sat, Oct 6, 2012 at 3:55 PM, neuron005 <[hidden email]> wrote:
Hi

I want to run a script which keeps monitoring a folder. If an
object(image/video) is put into it , try to copy it to another location and
other operations. How can I do that in my grails application. Ho to check if
something new is added to the folder and what is it ? This is urgent. If
anyone has solution, please provide .


Thanks




--
View this message in context: http://grails.1312388.n4.nabble.com/How-to-monitor-a-folder-tp4635968.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: How to monitor a folder ?

bdrhoa
In reply to this post by neuron005

I have  some links I've been saving for this kind of task. But I haven't gotten to implementation yet. https://trac.maflt.org/web/ibidem/ticket/18

On Oct 6, 2012 12:57 PM, "neuron005" <[hidden email]> wrote:
Hi

I want to run a script which keeps monitoring a folder. If an
object(image/video) is put into it , try to copy it to another location and
other operations. How can I do that in my grails application. Ho to check if
something new is added to the folder and what is it ? This is urgent. If
anyone has solution, please provide .


Thanks




--
View this message in context: http://grails.1312388.n4.nabble.com/How-to-monitor-a-folder-tp4635968.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How to monitor a folder ?

ramzi.maalej
Definitly Java NIO is the best solution. However, it's requires Java 7


On 2012-10-06, at 4:21 PM, Brad Rhoads wrote:

I have  some links I've been saving for this kind of task. But I haven't gotten to implementation yet. https://trac.maflt.org/web/ibidem/ticket/18

On Oct 6, 2012 12:57 PM, "neuron005" <[hidden email]> wrote:
Hi

I want to run a script which keeps monitoring a folder. If an
object(image/video) is put into it , try to copy it to another location and
other operations. How can I do that in my grails application. Ho to check if
something new is added to the folder and what is it ? This is urgent. If
anyone has solution, please provide .


Thanks




--
View this message in context: http://grails.1312388.n4.nabble.com/How-to-monitor-a-folder-tp4635968.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: How to monitor a folder ?

Bob Brown


Hth

Bob

Sent from my iPad

On 07/10/2012, at 6:41 AM, Ramzi Maalej <[hidden email]> wrote:

Definitly Java NIO is the best solution. However, it's requires Java 7


On 2012-10-06, at 4:21 PM, Brad Rhoads wrote:

I have  some links I've been saving for this kind of task. But I haven't gotten to implementation yet. https://trac.maflt.org/web/ibidem/ticket/18

On Oct 6, 2012 12:57 PM, "neuron005" <[hidden email]> wrote:
Hi

I want to run a script which keeps monitoring a folder. If an
object(image/video) is put into it , try to copy it to another location and
other operations. How can I do that in my grails application. Ho to check if
something new is added to the folder and what is it ? This is urgent. If
anyone has solution, please provide .


Thanks




--
View this message in context: http://grails.1312388.n4.nabble.com/How-to-monitor-a-folder-tp4635968.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: How to monitor a folder ?

neuron005
In reply to this post by neuron005
Hi All
Thanks for your help. Appreciate it. I am looking into solutions provided by you. Meanwhile, I also found this link and trying to get it working. If anyone else can check how it works , that will be awesome.

https://github.com/grails/grails-core/blob/master/grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/DirectoryWatcher.java

Thanks
Cheers