|
||||||||
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(java.io.File file)
Constructor. |
|
FileDataSource(java.lang.String name)
Constructor. |
Method Summary | |
---|---|
java.lang.String |
getContentType()
Returns the MIME content type of the data. |
java.io.File |
getFile()
Returns the underlying file. |
java.io.InputStream |
getInputStream()
Returns an input stream from which the data can be read. |
java.lang.String |
getName()
Returns the underlying name of this object. |
java.io.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(java.io.File file)
file
- the underlying file to usepublic FileDataSource(java.lang.String name)
name
- the path to the underlying file to useMethod Detail |
---|
public java.io.InputStream getInputStream() throws java.io.IOException
DataSource
getInputStream
in interface DataSource
java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException
DataSource
getOutputStream
in interface DataSource
java.io.IOException
public java.lang.String getContentType()
DataSource
getContentType
in interface DataSource
public java.lang.String getName()
DataSource
getName
in interface DataSource
public java.io.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 |