Methods Summary |
---|
public java.lang.String | getContentType()This method returns the MIME type of the data in the form of a
string. This method uses the currently installed FileTypeMap. If
there is no FileTypeMap explictly set, the FileDataSource will
call the getDefaultFileTypeMap method on
FileTypeMap to acquire a default FileTypeMap. Note: By
default, the FileTypeMap used will be a MimetypesFileTypeMap.
// check to see if the type map is null?
if (typeMap == null)
return FileTypeMap.getDefaultFileTypeMap().getContentType(_file);
else
return typeMap.getContentType(_file);
|
public java.io.File | getFile()Return the File object that corresponds to this FileDataSource.
return _file;
|
public java.io.InputStream | getInputStream()This method will return an InputStream representing the
the data and will throw an IOException if it can
not do so. This method will return a new
instance of InputStream with each invocation.
return new FileInputStream(_file);
|
public java.lang.String | getName()Return the name of this object. The FileDataSource
will return the file name of the object.
return _file.getName();
|
public java.io.OutputStream | getOutputStream()This method will return an OutputStream representing the
the data and will throw an IOException if it can
not do so. This method will return a new instance of
OutputStream with each invocation.
return new FileOutputStream(_file);
|
public void | setFileTypeMap(javax.activation.FileTypeMap map)Set the FileTypeMap to use with this FileDataSource
typeMap = map;
|