Class FileLockUtils

java.lang.Object
org.aksw.commons.lock.FileLockUtils

public class FileLockUtils extends Object
Similar to ProcessFileLock
  • Constructor Details

    • FileLockUtils

      public FileLockUtils()
  • Method Details

    • open

      public static Ref<FileChannel> open(Path path, boolean readLockRequested, OpenOption... openOptions) throws IOException, InterruptedException
      Request an exclusive file channel. The reference to the channel can be shared among several threads, but the channel itself exists only once. Do not directly close the FileChannel! Always close the reference as this also releases locks.
      Parameters:
      path -
      readLockRequested -
      openOptions -
      Returns:
      Throws:
      IOException
      InterruptedException