|
Préférences
Moteurs de recherche
|
|||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.6.0
javax.activation
|
Constructor Summary | |
---|---|
FileDataSource(File file)
Creates a FileDataSource from a File object. |
|
FileDataSource(String name)
Creates a FileDataSource from the specified path name. |
Method Summary | |
---|---|
String |
getContentType()
This method returns the MIME type of the data in the form of a string. |
File |
getFile()
Return the File object that corresponds to this FileDataSource. |
InputStream |
getInputStream()
This method will return an InputStream representing the the data and will throw an IOException if it can not do so. |
String |
getName()
Return the name of this object. |
OutputStream |
getOutputStream()
This method will return an OutputStream representing the the data and will throw an IOException if it can not do so. |
void |
setFileTypeMap(FileTypeMap map)
Set the FileTypeMap to use with this FileDataSource |
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 filepublic FileDataSource(String name)
name
- the system-dependent file name.Method Detail |
---|
public InputStream getInputStream() throws IOException
getInputStream
in interface DataSource
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
in interface DataSource
IOException
public String getContentType()
getDefaultFileTypeMap
method on
FileTypeMap to acquire a default FileTypeMap. Note: By
default, the FileTypeMap used will be a MimetypesFileTypeMap.
getContentType
in interface DataSource
FileTypeMap.getDefaultFileTypeMap()
public String getName()
getName
in interface DataSource
DataSource
public File getFile()
public void setFileTypeMap(FileTypeMap map)
map
- The FileTypeMap for this object.