- java.lang.Object
-
- com.aoapps.hodgepodge.io.TempFile
-
@Deprecated public class TempFile extends Object
Deprecated.Please useTempFileContextasFile.deleteOnExit()is prone to memory leaks in long-running applications.Holds a reference to a temp file. Automatically deletes the file on JVM shutdown or whendelete()is explicitly called.- Author:
- AO Industries, Inc.
- See Also:
for a way to confine instance lifetime to a narrower scope than automatic garbage collection
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddelete()Deprecated.Deletes the underlying temp file immediately.FilegetFile()Deprecated.Gets the temp file.StringtoString()Deprecated.
-
-
-
Constructor Detail
-
TempFile
public TempFile(String prefix) throws IOException
Deprecated.- Throws:
IOException
-
TempFile
public TempFile(String prefix, String suffix) throws IOException
Deprecated.- Throws:
IOException
-
TempFile
public TempFile(String prefix, String suffix, File directory) throws IOException
Deprecated.Creates the temp directory if missing.- Throws:
IOException
-
-
Method Detail
-
delete
public void delete() throws IOExceptionDeprecated.Deletes the underlying temp file immediately. Subsequent calls will not delete the temp file, even if another file has the same path. If already deleted, has no effect.- Throws:
IOException
-
getFile
public File getFile() throws IllegalStateException
Deprecated.Gets the temp file.- Throws:
IllegalStateException- if already deleted
-
-