ch.randelshofer.activation
Class MultiFileTypeMap
java.lang.Object
javax.activation.FileTypeMap
ch.randelshofer.activation.MultiFileTypeMap
public class MultiFileTypeMap
- extends javax.activation.FileTypeMap
This file type map serves as a
container for a collection of file type maps.
- Version:
- 1.1 2002-02-12 Return application/octet-stream' for unknown data types.
1.0 1998-10-19
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6405 Immensee, Switzerland.
|
Method Summary |
void |
add(javax.activation.FileTypeMap fileTypeMap)
|
java.lang.String |
getContentType(java.io.File file)
Return the type of the file object. |
java.lang.String |
getContentType(java.lang.String filename)
Return the type of the file passed in. |
| Methods inherited from class javax.activation.FileTypeMap |
getDefaultFileTypeMap, setDefaultFileTypeMap |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultiFileTypeMap
public MultiFileTypeMap()
add
public void add(javax.activation.FileTypeMap fileTypeMap)
getContentType
public java.lang.String getContentType(java.io.File file)
- Return the type of the file object. This method
should always return a valid MIME type.
- Specified by:
getContentType in class javax.activation.FileTypeMap
- Parameters:
file - A file to be typed.
- Returns:
- The content type.
getContentType
public java.lang.String getContentType(java.lang.String filename)
- Return the type of the file passed in. This method
should always return a valid MIME type.
- Specified by:
getContentType in class javax.activation.FileTypeMap
- Parameters:
filename - The pathname of the file.
- Returns:
- The content type.