This discussion is archived
6 Replies Latest reply: Sep 11, 2010 10:30 PM by 843790 RSS

Folder Locking using java

843790 Newbie
Currently Being Moderated
Hi All,
I want to implement the folder locking using java.But i can't find any method to implement my requirement. I find one method to lock a file using FileChannelObject.tryLock() or FileChannelObject.lock() methods of FileLock class. But the main problem is that FileChannel object is coming through only by calling getChannel() method on a RandomAccessFile object or FileInputStream object only.
If i want to lock a folder i am not able to create the lock on it. So please provide me any example to create a lock on  a directory.

Thanks in advance.