public class FileDataSource extends Object implements DataSource
| Constructor and Description |
|---|
FileDataSource(File file)
Constructor.
|
FileDataSource(String name)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public FileDataSource(File file)
file - the underlying file to usepublic FileDataSource(String name)
name - the path to the underlying file to usepublic InputStream getInputStream() throws IOException
DataSourcegetInputStream in interface DataSourceIOExceptionpublic OutputStream getOutputStream() throws IOException
DataSourcegetOutputStream in interface DataSourceIOExceptionpublic String getContentType()
DataSourcegetContentType in interface DataSourcepublic String getName()
DataSourcegetName in interface DataSourcepublic File getFile()
public void setFileTypeMap(FileTypeMap map)
map - the file type map