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.
- Author:
- mressler
- See Also:
-
Field Summary
Fields 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
-
Constructor Details
-
AutoRemoveableFile
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-