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

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

public class MediaTypesUtils
extends java.lang.Object

Utility class for managing and fetching media types.


Constructor Summary
MediaTypesUtils()
           
 
Method Summary
static java.lang.String getCollectionMediaTypeMappings(Registry configSystemRegistry)
          Method to obtain the collection media types.
static java.lang.String getCollectionMediaTypeMappings(RegistryContext registryContext)
          Method to obtain the collection media types.
static java.lang.String getCustomUIMediaTypeMappings(Registry configSystemRegistry)
          Method to obtain the custom UI media types.
static java.lang.String getCustomUIMediaTypeMappings(RegistryContext registryContext)
          Method to obtain the custom UI media types.
static java.lang.String getMediaType(java.lang.String resourceName)
          Method to obtain the media type of a given resource.
static java.lang.String getResourceMediaTypeMappings(Registry configSystemRegistry)
          Method to obtain the resource media types.
static java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.String getMediaType(java.lang.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.


Copyright © 2011 WSO2 Inc. All Rights Reserved.