Lizzy v1.1.1

christophedelory.content.type
Class ContentTypeFactory

java.lang.Object
  extended by christophedelory.content.type.ContentTypeFactory

public final class ContentTypeFactory
extends Object

A content type factory.

Version:
$Revision: 92 $
Author:
Christophe Delory

Method Summary
 ContentType getContentType(String contentName)
          Returns a content type representing the given content name (file or URL).
 ContentType getContentType(URI uri)
          Returns a content type representing the given content URI.
static ContentTypeFactory getInstance()
          Returns the unique class instance.
 void reloadProviders()
          Refreshes the list of providers managed by this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ContentTypeFactory getInstance()
Returns the unique class instance.

Returns:
an instance of this class. Shall not be null.

reloadProviders

public void reloadProviders()
Refreshes the list of providers managed by this factory. If new providers are added after the instantiation of this factory, you will need to call this method manually.


getContentType

public ContentType getContentType(String contentName)
Returns a content type representing the given content name (file or URL).

Parameters:
contentName - a content (file or URL) name. Shall not be null.
Returns:
a content type. May be null if none was found.
Throws:
NullPointerException - if contentName is null.
SecurityException - if a required system property value cannot be accessed.
See Also:
getContentType(java.lang.String)

getContentType

public ContentType getContentType(URI uri)
Returns a content type representing the given content URI.

Parameters:
uri - a content URI. Shall not be null.
Returns:
a content type. May be null if none was found.
Throws:
NullPointerException - if uri is null.
See Also:
ContentTypeProvider.getContentType(java.lang.String)

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.