Class FileLocker

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public final class FileLocker
    extends java.lang.Object
    implements java.io.Closeable
    • Method Summary

      Modifier and Type Method Description
      void close()  
      static FileLocker lock​(java.io.File lockFile)  
      static FileLocker tryLock​(java.io.File lockFile)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • lock

        public static FileLocker lock​(java.io.File lockFile)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • tryLock

        @Nullable
        public static FileLocker tryLock​(java.io.File lockFile)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException