org.apache.jackrabbit.server.io
Class MimeResolver

java.lang.Object
  extended by org.apache.jackrabbit.server.io.MimeResolver

public class MimeResolver
extends Object

This Class implements a very simple mime type resolver.


Constructor Summary
MimeResolver()
          Creates a new mimetype resolver containing the default mappings and having "application/octet-stream" set as default mimetype.
MimeResolver(Properties additionalProperties, String defaultMimeType)
          Creates a new mime type resolver extending the default mapping by the entries of the given Properties.
 
Method Summary
 String getDefaultMimeType()
          Returns the default mime type
 String getMimeType(String filename)
          Retrusn the mime type for the given name.
 void setDefaultMimeType(String defaultMimeType)
          Sets the default mime type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeResolver

public MimeResolver()
Creates a new mimetype resolver containing the default mappings and having "application/octet-stream" set as default mimetype.


MimeResolver

public MimeResolver(Properties additionalProperties,
                    String defaultMimeType)
Creates a new mime type resolver extending the default mapping by the entries of the given Properties. The default mimetype is set to the given defaultMimeType.

Parameters:
additionalProperties - MimeType mappings to be added to the default properties.
defaultMimeType - The default mimetype. A non-null String with a length greater than 0.
Method Detail

getDefaultMimeType

public String getDefaultMimeType()
Returns the default mime type

Returns:

setDefaultMimeType

public void setDefaultMimeType(String defaultMimeType)
Sets the default mime type

Parameters:
defaultMimeType -

getMimeType

public String getMimeType(String filename)
Retrusn the mime type for the given name.

Parameters:
filename -
Returns:


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.