?
Solved

java NIO folder watch on a remote server

Posted on 2012-09-14
8
Medium Priority
?
2,056 Views
Last Modified: 2012-10-29
I am writing a Java application (on red hat Linux) which will monitor a folder on a remote Linux (Red Hat) server.

The problem I am having is that unlike Windows I am not able to use UNC paths. I did see a suggestion on the forums elsewhere to mount the remote folder, which I did but NIO is unable to watch the mounted folder.

Both Linux machines are on the same network.

Any help would be much appreciated.
0
Comment
Question by:pboustani
  • 4
  • 4
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 38400322
You're almost certainly going to have to resort to polling
0
 

Author Comment

by:pboustani
ID: 38400506
Thanks CEHJ for your quick response. Is this because I am watching a remote folder?

I missed to mention earlier that the program works if I am watching a local folder.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 1500 total points
ID: 38400524
Is this because I am watching a remote folder?
Yes, there are no mechanisms immediately usable by java to propagate changes across a network
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:pboustani
ID: 38400766
Thanks, can you please point me to a good resource to learn polling techniques using Java, possibly with examples.

I have been looking on the internet but all examples use path on the local system.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 38401293
0
 

Author Comment

by:pboustani
ID: 38410835
trying different options, will report in a day or so
0
 

Author Comment

by:pboustani
ID: 38547189
I ended up creating a mount on my local pc and the program that generates the data writes on the mount as well.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 38547209
ok :)
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month15 days, 3 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question