org.xnap.search
Class DefaultMediaType

java.lang.Object
  extended by org.xnap.search.DefaultMediaType
All Implemented Interfaces:
java.io.Serializable, MediaType

public class DefaultMediaType
extends java.lang.Object
implements MediaType, java.io.Serializable

Provides a default implementation for the MediaType interface.

See Also:
Serialized Form

Constructor Summary
DefaultMediaType(java.lang.String realm, java.lang.String name)
           
 
Method Summary
 void add(java.lang.String extension)
          Adds extension to the list of extensions.
 java.lang.String getName()
          Returns the name of the media type that is shown to the user.
 java.lang.String getRealm()
          Returns the realm.
 boolean matches(java.lang.String filename)
          Returns true if filename is of this media type.
 java.lang.String toString()
          Returns the value of getName().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMediaType

public DefaultMediaType(java.lang.String realm,
                        java.lang.String name)
Method Detail

add

public void add(java.lang.String extension)
Adds extension to the list of extensions.


getName

public java.lang.String getName()
Returns the name of the media type that is shown to the user.

Specified by:
getName in interface MediaType

getRealm

public java.lang.String getRealm()
Returns the realm. This can be "anything", "audio", "video"...

Specified by:
getRealm in interface MediaType

matches

public boolean matches(java.lang.String filename)
Returns true if filename is of this media type.

Specified by:
matches in interface MediaType

toString

public java.lang.String toString()
Returns the value of getName().

Overrides:
toString in class java.lang.Object


Copyright © 2001-2005 XNap Team. All Rights Reserved.