Package ws.schild.jave.utils
Class AutoRemoveableFile
java.lang.Object
java.io.File
ws.schild.jave.utils.AutoRemoveableFile
- All Implemented Interfaces:
Serializable,AutoCloseable,Comparable<File>
Use this class in a try-with-resources block to automatically delete the referenced file when
this goes out of scope.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate static final longFields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
AutoRemoveableFile
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-