org.wso2.carbon.registry.core.utils
Class MediaTypesUtils

java.lang.Object
  extended by org.wso2.carbon.registry.core.utils.MediaTypesUtils

public class MediaTypesUtils
extends Object

Utility class for managing and fetching media types.


Constructor Summary
MediaTypesUtils()
           
 
Method Summary
static String getAllHumanTypes()
           
static String getCollectionMediaTypeMappings(Registry configSystemRegistry)
          Method to obtain the collection media types.
static String getCollectionMediaTypeMappings(RegistryContext registryContext)
          Method to obtain the collection media types.
static String getCustomUIMediaTypeMappings(Registry configSystemRegistry)
          Method to obtain the custom UI media types.
static String getCustomUIMediaTypeMappings(RegistryContext registryContext)
          Method to obtain the custom UI media types.
static String getHumanReadableMediaTypeFromMimeType(String mediaType)
           
static String getMediaType(String resourceName)
          Method to obtain the media type of a given resource.
static String getMimeTypeFromHumanReadableMediaType(String mediaType)
          Method to obtain the mime type when the human readable media type is given
static String getResourceMediaTypeMappings(Registry configSystemRegistry)
          Method to obtain the resource media types.
static String getResourceMediaTypeMappings(RegistryContext registryContext)
          Method to obtain the resource media types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaTypesUtils

public MediaTypesUtils()
Method Detail

getCollectionMediaTypeMappings

public static String getCollectionMediaTypeMappings(RegistryContext registryContext)
                                             throws RegistryException
Method to obtain the collection media types.

Parameters:
registryContext - the registry context.
Returns:
a String of collection media types, in the format name:type,name:type,...
Throws:
RegistryException - if the operation failed.

getCollectionMediaTypeMappings

public static String getCollectionMediaTypeMappings(Registry configSystemRegistry)
                                             throws RegistryException
Method to obtain the collection media types.

Parameters:
configSystemRegistry - a configuration system registry instance.
Returns:
a String of collection media types, in the format name:type,name:type,...
Throws:
RegistryException - if the operation failed.

getCustomUIMediaTypeMappings

public static String getCustomUIMediaTypeMappings(RegistryContext registryContext)
                                           throws RegistryException
Method to obtain the custom UI media types.

Parameters:
registryContext - the registry context.
Returns:
a String of custom UI media types, in the format name:type,name:type,...
Throws:
RegistryException - if the operation failed.

getCustomUIMediaTypeMappings

public static String getCustomUIMediaTypeMappings(Registry configSystemRegistry)
                                           throws RegistryException
Method to obtain the custom UI media types.

Parameters:
configSystemRegistry - a configuration system registry instance.
Returns:
a String of custom UI media types, in the format name:type,name:type,...
Throws:
RegistryException - if the operation failed.

getResourceMediaTypeMappings

public static String getResourceMediaTypeMappings(RegistryContext registryContext)
                                           throws RegistryException
Method to obtain the resource media types.

Parameters:
registryContext - the registry context.
Returns:
a String of resource media types, in the format extension:type,extension:type,...
Throws:
RegistryException - if the operation failed.

getResourceMediaTypeMappings

public static String getResourceMediaTypeMappings(Registry configSystemRegistry)
                                           throws RegistryException
Method to obtain the resource media types.

Parameters:
configSystemRegistry - a configuration system registry instance.
Returns:
a String of resource media types, in the format extension:type,extension:type,...
Throws:
RegistryException - if the operation failed.

getMediaType

public static String getMediaType(String resourceName)
                           throws RegistryException
Method to obtain the media type of a given resource.

Parameters:
resourceName - the name of the resource.
Returns:
the media type.
Throws:
RegistryException - if the operation failed.

getMimeTypeFromHumanReadableMediaType

public static String getMimeTypeFromHumanReadableMediaType(String mediaType)
Method to obtain the mime type when the human readable media type is given

Parameters:
mediaType - - the human readable media type
Returns:
the mime type

getHumanReadableMediaTypeFromMimeType

public static String getHumanReadableMediaTypeFromMimeType(String mediaType)

getAllHumanTypes

public static String getAllHumanTypes()


Copyright © 2012 WSO2 Inc. All Rights Reserved.