aspose file tools*
The moose likes Java in General and the fly likes Locking files in java. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Locking files in java." Watch "Locking files in java." New topic
Author

Locking files in java.

sneha ulhe
Ranch Hand

Joined: May 15, 2012
Posts: 45

Is there any way using which we can lock files in simple java...?


Sneha
[OCJP 6]
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18748
    
  40


Never had the need to do this myself, so take with a grain of salt.... Take a look at the FileChannel and FileLock classes.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
Hi Sneha,

Did you tried the . Hope it helps

Regards,
Vishal


Programming is about thinking, NOT coding
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Locking files in java.