com.wewebu.ow.server.util
Class OwMimeTypes

java.lang.Object
  extended by com.wewebu.ow.server.util.OwMimeTypes

public class OwMimeTypes
extends Object

Utility class for mimetype descriptions mappings.
If the client wants to add more MIME types, or overwrite the existing settings, the owdummy configuration provide a file called e.g. mimetypes.properties, as an example.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Nested Class Summary
protected static class OwMimeTypes.OwFileObjectStatics
           Mimetypes singleton with mimetype file extension mappings.
 
Field Summary
static String EXTENSION_FIELD
          embedded extension field (IBM On Demand compatible)
protected static OwMimeTypes.OwFileObjectStatics m_MimeTypes
          mimetypes singleton
 
Constructor Summary
OwMimeTypes()
           
 
Method Summary
static String getExtensionFromMime(String strMimeType_p)
          get a file extension from MIME type
static String getMimeParameter(String strMimeParameter_p, String strParameterName_p)
          retrieve a parameter from a MIME parameter string e.g.
static String getMimeTypeFromExtension(String strExtension_p)
          get MIME type from extension
static void loadFromUrl(URL propsURL_p)
          init the MimeType - loading data from URL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_MimeTypes

protected static final OwMimeTypes.OwFileObjectStatics m_MimeTypes
mimetypes singleton


EXTENSION_FIELD

public static final String EXTENSION_FIELD
embedded extension field (IBM On Demand compatible)

See Also:
Constant Field Values
Constructor Detail

OwMimeTypes

public OwMimeTypes()
Method Detail

getExtensionFromMime

public static String getExtensionFromMime(String strMimeType_p)
get a file extension from MIME type

Parameters:
strMimeType_p - String MIME type, can be null
Returns:
String the file extension, or null if not found

getMimeTypeFromExtension

public static String getMimeTypeFromExtension(String strExtension_p)
get MIME type from extension

Parameters:
strExtension_p - String extension, can be null
Returns:
String the MIME type, or null if not found

getMimeParameter

public static String getMimeParameter(String strMimeParameter_p,
                                      String strParameterName_p)
retrieve a parameter from a MIME parameter string e.g. text/HTML;name=hallo.txt -> retrieve parameter name results in hallo.txt

Parameters:
strParameterName_p - String name of parameter to retrieve
Returns:
String parameter, or null if not found

loadFromUrl

public static void loadFromUrl(URL propsURL_p)
                        throws Exception
init the MimeType - loading data from URL

Parameters:
propsURL_p - URL
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.