public static class FS.LockToken
extends java.lang.Object
implements java.io.Closeable
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.Modifier and Type | Field and Description |
---|---|
private boolean |
isCreated |
private java.util.Optional<java.nio.file.Path> |
link |
Constructor and Description |
---|
LockToken(boolean isCreated,
java.util.Optional<java.nio.file.Path> link) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
isCreated() |
java.lang.String |
toString() |
private boolean isCreated
private java.util.Optional<java.nio.file.Path> link
LockToken(boolean isCreated, java.util.Optional<java.nio.file.Path> link)
public boolean isCreated()
true
if the file was created successfullypublic void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public java.lang.String toString()
toString
in class java.lang.Object