Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File file = ...;
- FileInputStream fis = new FileInputStream(file); // or FileOutputStream fos = new FileOutputStream(file);
- FileLock lock = fis.getChannel().lock(); // or FileLock lock = fos.getChannel().lock();
- // do whatever you want with the file
- lock.release();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement