org.apache.turbine.services.mimetype.util
Class MimeType

java.lang.Object
  extended byorg.apache.turbine.services.mimetype.util.MimeType
All Implemented Interfaces:
java.lang.Cloneable

Deprecated. Use the Fulcrum Mimetype component instead.s

public class MimeType
extends java.lang.Object
implements java.lang.Cloneable

This class is used to represent parsed MIME types. The representation is parsed from a string based representation of the MIME type, as defined in the RFC1345.

Version:
$Id: MimeType.java,v 1.4 2003/10/24 12:45:58 epugh Exp $
Author:
Ilkka Priha

Field Summary
static MimeType APPLICATION_OCTET_STREAM
          Deprecated.  
static MimeType APPLICATION_POSTSCRIPT
          Deprecated.  
static MimeType APPLICATION_X_JAVA_AGENT
          Deprecated.  
static MimeType APPLICATION_X_WWW_FORM_URLENCODED
          Deprecated.  
static MimeType IMAGE_GIF
          Deprecated.  
static MimeType IMAGE_JPEG
          Deprecated.  
static MimeType IMAGE_WBMP
          Deprecated.  
static int MATCH_SPECIFIC_SUBTYPE
          Deprecated.  
static int MATCH_SUBTYPE
          Deprecated.  
static int MATCH_TYPE
          Deprecated.  
static MimeType MESSAGE_HTTP
          Deprecated.  
static MimeType MULTIPART
          Deprecated.  
static MimeType MULTIPART_FORM_DATA
          Deprecated.  
static int NO_MATCH
          Deprecated. MIME type matching constants.
static MimeType TEXT
          Deprecated.  
static MimeType TEXT_CHTML
          Deprecated.  
static MimeType TEXT_CSS
          Deprecated.  
static MimeType TEXT_HDML
          Deprecated.  
static MimeType TEXT_HTML
          Deprecated. A list of well known MIME types.
static MimeType TEXT_PLAIN
          Deprecated.  
static MimeType TEXT_WML
          Deprecated.  
 
Constructor Summary
MimeType(java.lang.String spec)
          Deprecated. Constructs a new MIME type by parsing a specification string.
MimeType(java.lang.String spec, boolean parsep)
          Deprecated. Constructs a new MIME type by parsing a specification string.
MimeType(java.lang.String type, java.lang.String subtype)
          Deprecated. Contructs a new MIME type from specified types.
MimeType(java.lang.String type, java.lang.String subtype, java.lang.String[] names, java.lang.String[] values)
          Deprecated. Contructs a new MIME type from specified parameters.
 
Method Summary
 void addParameter(java.lang.String param, java.lang.String value)
          Deprecated. Adds a parameter to the MIME type.
 void addParameters(java.lang.String[] params, java.lang.String[] values)
          Deprecated. Adds parameters to the MIME type.
 java.lang.String getParameter(java.lang.String param)
          Deprecated. Gets the value of a MIME type parameter.
 java.lang.String getSubtype()
          Deprecated. Gets the subtype of the MIME type.
 java.lang.String getType()
          Deprecated. Gets the main type of the MIME type.
 java.lang.String getTypes()
          Deprecated. Gets the type and the subtype of the MIME type.
 boolean hasParameter(java.lang.String param)
          Deprecated. Checks whether the MIME type contains the specified parameter.
 int match(MimeType other)
          Deprecated. Compares the specified MIME type to this one and returns a matching level: NO_MATCH=types do not match, MATCH_TYPE=types match, MATCH_SPECIFIC_TYPE=types match exactly, MATCH_SUBTYPE=types match, subtypes match too, MATCH_SPECIFIC_SUBTYPE=types match, subtypes match exactly.
 void setParameter(java.lang.String param, java.lang.String value)
          Deprecated. Sets the value of a MIME type parameter replacing the old one.
 java.lang.String toString()
          Deprecated. Converts the MIME type into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TEXT_HTML

public static MimeType TEXT_HTML
Deprecated. 
A list of well known MIME types.


TEXT_WML

public static MimeType TEXT_WML
Deprecated. 

TEXT_HDML

public static MimeType TEXT_HDML
Deprecated. 

TEXT_CHTML

public static MimeType TEXT_CHTML
Deprecated. 

TEXT_PLAIN

public static MimeType TEXT_PLAIN
Deprecated. 

MULTIPART

public static MimeType MULTIPART
Deprecated. 

MULTIPART_FORM_DATA

public static MimeType MULTIPART_FORM_DATA
Deprecated. 

APPLICATION_POSTSCRIPT

public static MimeType APPLICATION_POSTSCRIPT
Deprecated. 

APPLICATION_OCTET_STREAM

public static MimeType APPLICATION_OCTET_STREAM
Deprecated. 

APPLICATION_X_JAVA_AGENT

public static MimeType APPLICATION_X_JAVA_AGENT
Deprecated. 

APPLICATION_X_WWW_FORM_URLENCODED

public static MimeType APPLICATION_X_WWW_FORM_URLENCODED
Deprecated. 

MESSAGE_HTTP

public static MimeType MESSAGE_HTTP
Deprecated. 

TEXT_CSS

public static MimeType TEXT_CSS
Deprecated. 

TEXT

public static MimeType TEXT
Deprecated. 

IMAGE_GIF

public static MimeType IMAGE_GIF
Deprecated. 

IMAGE_JPEG

public static MimeType IMAGE_JPEG
Deprecated. 

IMAGE_WBMP

public static MimeType IMAGE_WBMP
Deprecated. 

NO_MATCH

public static final int NO_MATCH
Deprecated. 
MIME type matching constants.

See Also:
Constant Field Values

MATCH_TYPE

public static final int MATCH_TYPE
Deprecated. 
See Also:
Constant Field Values

MATCH_SUBTYPE

public static final int MATCH_SUBTYPE
Deprecated. 
See Also:
Constant Field Values

MATCH_SPECIFIC_SUBTYPE

public static final int MATCH_SPECIFIC_SUBTYPE
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

MimeType

public MimeType(java.lang.String spec)
Deprecated. 
Constructs a new MIME type by parsing a specification string.

Parameters:
spec - a string representing a MIME type.

MimeType

public MimeType(java.lang.String spec,
                boolean parsep)
Deprecated. 
Constructs a new MIME type by parsing a specification string.

Parameters:
spec - a string representing a MIME type.
parsep - a flag for parsing parameters also.
Throws:
java.lang.IllegalArgumentException - for parsing errors.

MimeType

public MimeType(java.lang.String type,
                java.lang.String subtype)
Deprecated. 
Contructs a new MIME type from specified types.

Parameters:
type - a type.
subtype - a subtype.
Throws:
java.lang.NullPointerException - if type or subtype are nulls.

MimeType

public MimeType(java.lang.String type,
                java.lang.String subtype,
                java.lang.String[] names,
                java.lang.String[] values)
Deprecated. 
Contructs a new MIME type from specified parameters.

Parameters:
type - a type.
subtype - a subtype.
names - parameters names.
values - parameter values.
Throws:
java.lang.NullPointerException - if type or subtype are nulls.
Method Detail

match

public int match(MimeType other)
Deprecated. 
Compares the specified MIME type to this one and returns a matching level: NO_MATCH=types do not match, MATCH_TYPE=types match, MATCH_SPECIFIC_TYPE=types match exactly, MATCH_SUBTYPE=types match, subtypes match too, MATCH_SPECIFIC_SUBTYPE=types match, subtypes match exactly.

Parameters:
other - the MimeType to compare.
Returns:
the matching level.

getType

public java.lang.String getType()
Deprecated. 
Gets the main type of the MIME type.

Returns:
the main type as a string.

getSubtype

public java.lang.String getSubtype()
Deprecated. 
Gets the subtype of the MIME type.

Returns:
the subtype as a string.

getTypes

public java.lang.String getTypes()
Deprecated. 
Gets the type and the subtype of the MIME type.

Returns:
the types as a string.

hasParameter

public boolean hasParameter(java.lang.String param)
Deprecated. 
Checks whether the MIME type contains the specified parameter.

Parameters:
param - the name opf the parameter.
Returns:
true if the parameter found, otherwise false.

getParameter

public java.lang.String getParameter(java.lang.String param)
Deprecated. 
Gets the value of a MIME type parameter. The first parameter with the specifed name will be returned.

Parameters:
param - the name of the parameter.
Returns:
the value of the parameter, or null.

setParameter

public void setParameter(java.lang.String param,
                         java.lang.String value)
Deprecated. 
Sets the value of a MIME type parameter replacing the old one.

Parameters:
param - the name of the parameter.
value - the value of the parameter.

addParameter

public void addParameter(java.lang.String param,
                         java.lang.String value)
Deprecated. 
Adds a parameter to the MIME type.

Parameters:
param - the name of the parameter.
value - the value of the parameter.

addParameters

public void addParameters(java.lang.String[] params,
                          java.lang.String[] values)
Deprecated. 
Adds parameters to the MIME type.

Parameters:
params - an array of parameter names.
values - an array of parameter values.

toString

public java.lang.String toString()
Deprecated. 
Converts the MIME type into a string.

Returns:
the string representation of the MIME type.


Copyright © 2000-2004 Apache Software Foundation. All Rights Reserved.