Class FS.LockToken

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

    public static class FS.LockToken
    extends java.lang.Object
    implements java.io.Closeable
    A token representing a file created by FS.createNewFileAtomic(File). The token must be retained until the file has been deleted in order to guarantee that the unique file was created atomically. As soon as the file is no longer needed the lock token must be closed.
    Since:
    4.7
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean isCreated  
      private java.util.Optional<java.nio.file.Path> link  
    • Constructor Summary

      Constructors 
      Constructor Description
      LockToken​(boolean isCreated, java.util.Optional<java.nio.file.Path> link)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      boolean isCreated()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • isCreated

        private boolean isCreated
      • link

        private java.util.Optional<java.nio.file.Path> link
    • Constructor Detail

      • LockToken

        LockToken​(boolean isCreated,
                  java.util.Optional<java.nio.file.Path> link)
    • Method Detail

      • isCreated

        public boolean isCreated()
        Returns:
        true if the file was created successfully
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object