Package xj3d.filter
Class ParserNameMap
java.lang.Object
xj3d.filter.ParserNameMap
- All Implemented Interfaces:
FileNameMap,org.ietf.uri.FileNameMap
FileNameMap for the URL resolution system so that content types can be
accurately determined, even when the local platform does not have a
mapping.
Will automatically test all extensions against lower case forms. Will automatically lower case anything that is added to this map.
- Version:
- $Revision: 1.2 $
- Author:
- Justin Couch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContentTypeFor(String filename) Gets the MIME type for the specified file name.getFileExtension(String mimetype) Gets the file extension for the specified mime type.voidregisterType(String extension, String mimetype) Register a file type and corresponding extension.
-
Constructor Details
-
ParserNameMap
public ParserNameMap()Create a new empty map instance.
-
-
Method Details
-
getFileExtension
Gets the file extension for the specified mime type. If none is known, return null. Always will return the lower-case form of what was originally registered, regardless of what case was provided.- Specified by:
getFileExtensionin interfaceorg.ietf.uri.FileNameMap- Parameters:
mimetype- The mimetype to extract an extension for- Returns:
- The matching extension type or null if not known
-
getContentTypeFor
Gets the MIME type for the specified file name. If none is known, return null.- Specified by:
getContentTypeForin interfaceFileNameMap- Parameters:
filename- The filename to extract an extension from- Returns:
- The matching MIME type or null if not known
-
registerType
-