info.magnolia.cms.beans.config
Class MIMEMapping

java.lang.Object
  extended by info.magnolia.cms.beans.config.MIMEMapping

public class MIMEMapping
extends java.lang.Object

Manages mappings of file extensions with their MIME types and icon.

Version:
1.1
Author:
Sameer Charles

Nested Class Summary
protected static class MIMEMapping.MIMEMappingItem
          Used to keep the configuration in memory.
 
Field Summary
static java.lang.String DEFAULT_ICON
           
static java.lang.String ICONS_PATH
           
 
Method Summary
static java.lang.String getContentEncoding(java.lang.String contentType)
           
static java.lang.String getContentEncodingOrDefault(java.lang.String contentType)
           
static java.lang.String getMIMEType(java.lang.String key)
          Get MIME type String.
static java.lang.String getMIMETypeIcon(java.lang.String extension)
          Returns the icon used for rendering this type.
static java.lang.String getMIMETypeOrDefault(java.lang.String extension)
          Returns the mime-type associated with this extension, or the server's default.
static void init()
          Reads all configured mime mapping (config/server/MIMEMapping).
static void load()
          Reads all configured mime mapping (config/server/MIMEMapping).
static void reload()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ICONS_PATH

public static final java.lang.String ICONS_PATH
See Also:
Constant Field Values

DEFAULT_ICON

public static final java.lang.String DEFAULT_ICON
See Also:
Constant Field Values
Method Detail

init

public static void init()
Reads all configured mime mapping (config/server/MIMEMapping).


load

public static void load()
Reads all configured mime mapping (config/server/MIMEMapping).


reload

public static void reload()

getMIMEType

public static java.lang.String getMIMEType(java.lang.String key)
Get MIME type String.

Parameters:
key - extension for which MIME type is requested
Returns:
MIME type

getMIMETypeOrDefault

public static java.lang.String getMIMETypeOrDefault(java.lang.String extension)
Returns the mime-type associated with this extension, or the server's default.


getContentEncoding

public static java.lang.String getContentEncoding(java.lang.String contentType)

getContentEncodingOrDefault

public static java.lang.String getContentEncodingOrDefault(java.lang.String contentType)

getMIMETypeIcon

public static java.lang.String getMIMETypeIcon(java.lang.String extension)
Returns the icon used for rendering this type.

Returns:
the icon name


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.