javax.activation

Class FileDataSource

public class FileDataSource extends Object implements DataSource

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
StringgetContentType()
Returns the content type of the data source
FilegetFile()
Returns the data source file
InputStreamgetInputStream()
Return the InputStream obtained from the data source
StringgetName()
Returns the name of the data source object
OutputStreamgetOutputStream()
Return the OutputStream obtained from the data source
voidsetFileTypeMap(FileTypeMap map)
Sets the FileTypeMap associated with the data source

Constructor Detail

FileDataSource

public FileDataSource(File file)
Creates a FileDataSource from a File object

FileDataSource

public FileDataSource(String name)
Creates a FileDataSource from the specified path name

Method Detail

getContentType

public String getContentType()
Returns the content type of the data source

getFile

public File getFile()
Returns the data source file

getInputStream

public InputStream getInputStream()
Return the InputStream obtained from the data source

getName

public String getName()
Returns the name of the data source object

getOutputStream

public OutputStream getOutputStream()
Return the OutputStream obtained from the data source

setFileTypeMap

public void setFileTypeMap(FileTypeMap map)
Sets the FileTypeMap associated with the data source