⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
javax.activation

Class FileDataSource

java.lang.Object
|
+--javax.activation.FileDataSource

All Implemented Interfaces:
DataSource


public class FileDataSource
extends java.lang.Object
implements DataSource

Data source encapsulating a file.
Author:

Constructor Summary

FileDataSource(File file)

Constructor.

FileDataSource(String name)

Constructor.

Method Summary

String

getContentType()

File

getFile()

Returns the underlying file.

InputStream

getInputStream()

String

getName()

OutputStream

getOutputStream()

void

setFileTypeMap(FileTypeMap map)

Sets the file type map to use to determine the content type of the file.

Constructor Details

FileDataSource

public FileDataSource(File file)

Constructor.

Parameters:
file - the underlying file to use

FileDataSource

public FileDataSource(String name)

Constructor.

Parameters:
name - the path to the underlying file to use

Method Details

getContentType

public String getContentType()


getFile

public File getFile()

Returns the underlying file.


getInputStream

public InputStream getInputStream()


getName

public String getName()


getOutputStream

public OutputStream getOutputStream()


setFileTypeMap

public void setFileTypeMap(FileTypeMap map)

Sets the file type map to use to determine the content type of the file.

Parameters:
map - the file type map