public class ScratchFile extends Object implements Closeable
Constructor and Description |
---|
ScratchFile(File file,
String mimeType,
String disposition)
Create a new scratch file, which will be deleted by
File.delete() . |
ScratchFile(org.clazzes.util.aop.IFileDeleter fileDeleter,
File file,
String mimeType,
String disposition)
Create a new scratch file, which will be deleted by
IFileDeleter.deleteFile(File) . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
deleteAndClose()
No-throw variant for closing this object and deleting the underlying
file on the file system.
|
void |
finalize() |
String |
getDisposition() |
File |
getFile() |
String |
getMimeType() |
boolean |
isClosed() |
String |
toString() |
public ScratchFile(File file, String mimeType, String disposition)
File.delete()
.
If you want your file robustly deleted, use the constructor
ScratchFile(IFileDeleter, File, String, String)
.file
- The file to be deliveredmimeType
- The MIME type of the contentdisposition
- The content-disposition a known from the likewise HTTP header.public ScratchFile(org.clazzes.util.aop.IFileDeleter fileDeleter, File file, String mimeType, String disposition)
IFileDeleter.deleteFile(File)
.fileDeleter
- A file deleter used to robustely delete the scratch file.file
- The file to be deliveredmimeType
- The MIME type of the contentdisposition
- The content-disposition a known from the likewise HTTP header.public File getFile()
public String getMimeType()
public String getDisposition()
public boolean isClosed()
public void deleteAndClose()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void finalize() throws Throwable
Copyright © 2016 Clazzes.org. All rights reserved.