javax.activation
Class FileDataSource

java.lang.Object
  extended by javax.activation.FileDataSource
All Implemented Interfaces:
DataSource

public class FileDataSource
extends Object
implements DataSource

Version:
$Rev: 123383 $ $Date: 2004-12-26 19:11:00 -0800 (Sun, 26 Dec 2004) $

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()
          Returns the content type of the data source
 File getFile()
          Returns the data source file
 InputStream getInputStream()
          Return the InputStream obtained from the data source
 String getName()
          Returns the name of the data source object
 OutputStream getOutputStream()
          Return the OutputStream obtained from the data source
 void setFileTypeMap(FileTypeMap map)
          Sets the FileTypeMap associated with the data source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getInputStream

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

Specified by:
getInputStream in interface DataSource
Throws:
IOException

getOutputStream

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

Specified by:
getOutputStream in interface DataSource
Throws:
IOException

getContentType

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

Specified by:
getContentType in interface DataSource

getName

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

Specified by:
getName in interface DataSource

getFile

public File getFile()
Returns the data source file


setFileTypeMap

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



Copyright © 2006 Apache Software Foundation. All Rights Reserved.