: Class FileDataSource

Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.activation
Class FileDataSource

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

All Implemented Interfaces:
  DataSource

public class FileDataSource
extends java.lang.Object
implements DataSource

File Data Source.

Version:
  $Revision: 1.3 $
Author:
  Andrew Selkirk

Constructor Summary
`FileDataSource(java.io.File file)` Create file data source
`FileDataSource(java.lang.String name)` Create file data source.

Method Summary
`java.lang.String` | `getContentType()` Get content type.
`java.io.File` | `getFile()` Get file.
`java.io.InputStream` | `getInputStream()` Get input stream.
`java.lang.String` | `getName()` Get name.
`java.io.OutputStream` | `getOutputStream()` Get output stream.
`void` | `setFileTypeMap(FileTypeMap map)` Set file type map.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FileDataSource

    public FileDataSource(java.lang.String name)

  Create file data source.
  Parameters:
    `name` - Filename

### FileDataSource

    public FileDataSource(java.io.File file)

  Create file data source
  Parameters:
    `file` - File source

Method Detail

### getName

    public java.lang.String getName()

  Get name.
  Specified by:
    `getName` in interface `DataSource`
  Returns:
    Name

### getFile

    public java.io.File getFile()

  Get file.
  Returns:
    File

### getInputStream

    public java.io.InputStream getInputStream()
                                       throws java.io.IOException

  Get input stream.
  Specified by:
    `getInputStream` in interface `DataSource`
  Returns:
    Input stream
  Throws:
    `java.io.IOException` - IO exception occurred

### getContentType

    public java.lang.String getContentType()

  Get content type.
  Specified by:
    `getContentType` in interface `DataSource`
  Returns:
    Content type

### getOutputStream

    public java.io.OutputStream getOutputStream()
                                         throws java.io.IOException

  Get output stream.
  Specified by:
    `getOutputStream` in interface `DataSource`
  Returns:
    Output stream
  Throws:
    `java.io.IOException` - IO exception occurred

### setFileTypeMap

    public void setFileTypeMap(FileTypeMap map)

  Set file type map.
  Parameters:
    `map` - File type map

Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

© Copyright 2002 the Free Software Foundation, all rights reserved.