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 Details

    • MimeTable

      public MimeTable()
  • Method Details

    • 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 document
      documentStandardId - 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.