: Class FileTypeMap

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 FileTypeMap

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

Direct Known Subclasses:
  MimetypesFileTypeMap

public abstract class FileTypeMap
extends java.lang.Object

File Type Map abstract class provides an interface to the data typing of data files. The class is designed to allow the plugging in of any algorithm as the system default engine to determine the data content type of files. By default, the activation framework uses the MimeTypeFileTypeMap.

Version:
  $Revision: 1.5 $
Author:
  Andrew Selkirk

Constructor Summary
`FileTypeMap()` Default constructor of FileTypeMap

Method Summary
`abstract java.lang.String` | `getContentType(java.io.File file)` Get the MIME content type of the specified file.
`abstract java.lang.String` | `getContentType(java.lang.String filename)` Get the MIME content type of the specified file
`static FileTypeMap` | `getDefaultFileTypeMap()` Get the system default file type mapping algorithm.
`static void` | `setDefaultFileTypeMap(FileTypeMap fileTypeMap)` Set the system default file type mapping algorithm.

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

Constructor Detail

### FileTypeMap

    public FileTypeMap()

  Default constructor of FileTypeMap

Method Detail

### getContentType

    public abstract java.lang.String getContentType(java.lang.String filename)

  Get the MIME content type of the specified file
  Parameters:
    `filename` - Filename of file to query
  Returns:
    MIME content type of file

### getContentType

    public abstract java.lang.String getContentType(java.io.File file)

  Get the MIME content type of the specified file.
  Parameters:
    `file` - File to query
  Returns:
    MIME content type of file

### getDefaultFileTypeMap

    public static FileTypeMap getDefaultFileTypeMap()

  Get the system default file type mapping algorithm. Unless otherwise modified, this will be an instance of the MimetypesFileTypeMap engine.
  Returns:
    System default file type map
  See Also:
    `MimetypesFileTypeMap`, `setDefaultFileTypeMap(javax.activation.FileTypeMap)`

### setDefaultFileTypeMap

    public static void setDefaultFileTypeMap(FileTypeMap fileTypeMap)

  Set the system default file type mapping algorithm.
  Parameters:
    `fileTypeMap` - File type map to set as the system default
  Throws:
    `java.lang.SecurityException` - Unsufficient permission to change the system default
  See Also:
    `getDefaultFileTypeMap()`

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.