Package gov.nasa.pds.tools.util
Class MimeTable
- java.lang.Object
-
- gov.nasa.pds.tools.util.MimeTable
-
public class MimeTable extends Object
A class to encapsulate a home grown table to retrieve a mime type given a file name.
-
-
Constructor Summary
Constructors Constructor Description MimeTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContentType(String documentRef)
Given a file name, returns the mime type.ArrayList<String>
getPossibleFileExtensions(String documentStandardId)
Given a document standard id, returns a list of possible file extensions associated with that id.boolean
isMimeTypeCorrect(String documentRef, String documentStandardId)
Given a document file name, check for the mime type loaded into the hashmap.
-
-
-
Method Detail
-
getContentType
public String getContentType(String documentRef)
Given a file name, returns the mime type.- Parameters:
documentRef
- The file name of the document- Returns:
- mimeType The mime type
-
isMimeTypeCorrect
public boolean isMimeTypeCorrect(String documentRef, String documentStandardId)
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
public ArrayList<String> getPossibleFileExtensions(String documentStandardId)
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.
-
-