File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 46

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: 18914
    
  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
 
jQuery in Action, 2nd edition
 
subject: Locking files in java.