|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.mime.datasource.FileDataSource
public final class FileDataSource
FileDataSource - A simple data source that encapsulates a file.
| Constructor Summary | |
|---|---|
FileDataSource(java.io.File file)
Creates a FileDataSource from a File object. |
|
FileDataSource(java.io.File file,
java.lang.String contentType)
Creates a FileDataSource from a File object. |
|
FileDataSource(java.lang.String name)
Creates a FileDataSource from the specified path name. |
|
FileDataSource(java.lang.String name,
java.lang.String contentType)
Creates a FileDataSource from the specified path name. |
|
| Method Summary | |
|---|---|
java.lang.String |
getContentType()
|
java.io.File |
getFile()
Return the file that corresponds to this FileDataSource. |
java.io.InputStream |
getInputStream()
|
java.lang.String |
getName()
|
java.io.OutputStream |
getOutputStream()
|
void |
setContentType(java.lang.String contentType)
Sets the content type. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileDataSource(java.io.File file)
Content type is initially set to "application/octet-stream".
file - The file
public FileDataSource(java.io.File file,
java.lang.String contentType)
file - The filecontentType - The content typepublic FileDataSource(java.lang.String name)
Content type is initially set to "application/octet-stream".
name - The system-dependent file name.
public FileDataSource(java.lang.String name,
java.lang.String contentType)
Content type is initially set to "application/octet-stream".
name - The system-dependent file name.contentType - The content type| Method Detail |
|---|
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface javax.activation.DataSourcejava.io.IOException
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface javax.activation.DataSourcejava.io.IOExceptionpublic java.lang.String getContentType()
getContentType in interface javax.activation.DataSourcepublic java.lang.String getName()
getName in interface javax.activation.DataSourcepublic java.io.File getFile()
public void setContentType(java.lang.String contentType)
contentType - The content type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||