Package com.metsci.glimpse.util.io
Class FileSync
- java.lang.Object
-
- com.metsci.glimpse.util.io.FileSync
-
public class FileSync extends Object
-
-
Constructor Summary
Constructors Constructor Description FileSync()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisHeldByCurrentThread(File file)static voidlockFile(File file)Locks the file.static voidunlockFile(File file)Unlocks the file.
-
-
-
Method Detail
-
lockFile
public static void lockFile(File file) throws IOException
Locks the file. This call is re-entrant. Each call on the same thread increases the hold count.- Throws:
IOException
-
isHeldByCurrentThread
public static boolean isHeldByCurrentThread(File file)
-
unlockFile
public static void unlockFile(File file) throws IOException
Unlocks the file. This call is re-entrant. Only when the calling thread has no more holds will the file be unlocked.- Throws:
IOException
-
-