/**
* Handles MIME types and maps them to file extensions.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
*/
public class MimeTypes {
/** The default MIME type for unknown extensions. */
- private static final String DEFAULT_CONTENT_TYPE = "application/octet-stream";
+ public static final String DEFAULT_CONTENT_TYPE = "application/octet-stream";
/** List of all MIME types. */
private static final List<String> mimeTypes = new ArrayList<String>();
/**
* Returns a list of all known MIME types.
- *
+ *
* @return All known MIME types
*/
public static List<String> getAllMimeTypes() {
/**
* Returns a list of MIME types that are registered for the given extension.
- *
+ *
* @param extension
* The extension to get the MIME types for
* @return A list of MIME types, or an empty list if there are no registered
* Returns a default MIME type for the given extension. If the extension
* does not match a MIME type the default MIME typ
* “application/octet-stream” is returned.
- *
+ *
* @param extension
* The extension to get the MIME type for
* @return The MIME type for the extension, or the default MIME type
/**
* Adds a MIME type and optional extensions.
- *
+ *
* @param mimeType
* The MIME type to add
* @param extensions