Interface MediaTypeService

All Known Implementing Classes:
GenericMediaTypeService

public interface MediaTypeService

A media type service provides methods to determine a media type based on a file name, a file extension, a path or a URI.

Since:
1.0
Author:
Jeremy Kuhn
  • Method Details

    • getForExtension

      String getForExtension(String extension)

      Determines the media type of the specified file extension.

      Parameters:
      extension - a file extension
      Returns:
      a media type or null if no known media type has been found for the specified file extension
    • getForFilename

      String getForFilename(String filename)

      Determines the media type of the specified file name.

      Parameters:
      filename - a file name
      Returns:
      a media type or null if no known media type has been found for the specified file name
    • getForPath

      String getForPath(Path path)

      Determines the media type of the specified path.

      Parameters:
      path - a path
      Returns:
      a media type or null if no known media type has been found for the specified path
    • getForUri

      String getForUri(URI uri)

      Determines the media type of the specified path.

      Parameters:
      uri - a URI
      Returns:
      a media type or null if no known media type has been found for the specified URI