|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.activation.FileDataSource
public class FileDataSource
Data source encapsulating a file.
Constructor Summary | |
---|---|
FileDataSource(File file)
Constructor. |
|
FileDataSource(String name)
Constructor. |
Method Summary | |
---|---|
String |
getContentType()
Returns the MIME content type of the data. |
File |
getFile()
Returns the underlying file. |
InputStream |
getInputStream()
Returns an input stream from which the data can be read. |
String |
getName()
Returns the underlying name of this object. |
OutputStream |
getOutputStream()
Returns an output stream to which the data can be written. |
void |
setFileTypeMap(FileTypeMap map)
Sets the file type map to use to determine the content type of the file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileDataSource(File file)
file
- the underlying file to usepublic FileDataSource(String name)
name
- the path to the underlying file to useMethod Detail |
---|
public InputStream getInputStream() throws IOException
DataSource
getInputStream
in interface DataSource
IOException
public OutputStream getOutputStream() throws IOException
DataSource
getOutputStream
in interface DataSource
IOException
public String getContentType()
DataSource
getContentType
in interface DataSource
public String getName()
DataSource
getName
in interface DataSource
public File getFile()
public void setFileTypeMap(FileTypeMap map)
map
- the file type map
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |