Package ws.schild.jave.utils
Class AutoRemoveableFile
- java.lang.Object
-
- java.io.File
-
- ws.schild.jave.utils.AutoRemoveableFile
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.AutoCloseable,java.lang.Comparable<java.io.File>
public class AutoRemoveableFile extends java.io.File implements java.lang.AutoCloseableUse this class in a try-with-resources block to automatically delete the referenced file when this goes out of scope.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Loggerloggerprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description AutoRemoveableFile(java.io.File parent, java.lang.String child)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()-
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 Detail
-
logger
private static final org.slf4j.Logger logger
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-