Package gov.nasa.pds.tools.util
Class MimeTable
java.lang.Object
gov.nasa.pds.tools.util.MimeTable
A class to encapsulate a home grown table to retrieve a mime type given a file name.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContentType(String documentRef) Given a file name, returns the mime type.getPossibleFileExtensions(String documentStandardId) Given a document standard id, returns a list of possible file extensions associated with that id.booleanisMimeTypeCorrect(String documentRef, String documentStandardId) Given a document file name, check for the mime type loaded into the hashmap.
-
Constructor Details
-
MimeTable
public MimeTable()
-
-
Method Details
-
getContentType
Given a file name, returns the mime type.- Parameters:
documentRef- The file name of the document- Returns:
- mimeType The mime type
-
isMimeTypeCorrect
Given a document file name, check for the mime type loaded into the hashmap.- Parameters:
documentRef- The file name of the documentdocumentStandardId- The document standard id as defined by the PDS Information Model document.- Returns:
- true if the mime type matches with was defined, false otherwise.
-
getPossibleFileExtensions
Given a document standard id, returns a list of possible file extensions associated with that id.- Parameters:
documentStandardId- The document standard id as defined by the PDS Information Model document.- Returns:
- extensionList List of file extensions allowed for that document standard id.
-