@Deprecated
public class TempFileDataSource
extends javax.activation.FileDataSource
Since this may cause problems if the getInputStream()
is called more than once, the file deletion is disabled if
that happens. Instead the File.deleteOnExit()
is
called to mark the file for deletion when the virtual machine exits.
Modifier and Type | Class and Description |
---|---|
private class |
TempFileDataSource.TempInputStream
Deprecated.
An InputStream implementation that deletes the source file
once the entire stream has been read (=any of the read()
methods return -1) or when close() is called.
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
mimeType
Deprecated.
|
private int |
numStreams
Deprecated.
|
Constructor and Description |
---|
TempFileDataSource(java.io.File file,
java.lang.String mimeType)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType()
Deprecated.
Get the supplied MIME type, if any.
|
java.io.InputStream |
getInputStream()
Deprecated.
Get an InputStream that deletes the source file as soon
as the end of file is reached or close() is called.
|
private final java.lang.String mimeType
private int numStreams
public TempFileDataSource(java.io.File file, java.lang.String mimeType)
public java.lang.String getContentType()
getContentType
in interface javax.activation.DataSource
getContentType
in class javax.activation.FileDataSource
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface javax.activation.DataSource
getInputStream
in class javax.activation.FileDataSource
java.io.IOException