Interface MimeMappingStrategy

All Known Implementing Classes:
DefaultMimeMappingStrategy

public interface MimeMappingStrategy
Strategy to compute a file's extension for a given mime type.
  • Method Details

    • fileExtensionForMimeType

      String fileExtensionForMimeType(String mimeType)
      Computes the file extension (e.g. 'gif' for 'image/gif', 'jpg' for 'image/jpeg') for the given mimetype.
      Parameters:
      mimeType - the mime type to get the file extension for.
      Returns:
      the file extension without a leading dot, or null if the specified mimeType is unknown or could not be mapped to a file extension.
    • determineMimeTypeByFileName

      String determineMimeTypeByFileName(String fileName)
      Determines the mime type by the file extension fo the given file name.
      Parameters:
      fileName - The name of the file withou path
      Returns:
      The mime type or null if no such mimetype is registered.