Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

Copyright © 2006 Sun Microsystems, Inc. All rights reserved.

JSR-927 (Maintenance Release)

javax.media.protocol
Class ContentDescriptor

java.lang.Object
  extended byjavax.media.protocol.ContentDescriptor

public class ContentDescriptor
extends java.lang.Object

A ContentDescriptor identifies media data containers.

See Also:
SourceStream

Field Summary
static java.lang.String CONTENT_UNKNOWN
           
protected  java.lang.String typeName
           
 
Constructor Summary
ContentDescriptor(java.lang.String cdName)
          Create a content descriptor with the specified name.
 
Method Summary
 java.lang.String getContentType()
          Obtain a string that represents the content-name for this descriptor.
static java.lang.String mimeTypeToPackageName(java.lang.String mimeType)
          Map a MIME content-type to an equivalent string of class-name components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_UNKNOWN

public static final java.lang.String CONTENT_UNKNOWN
See Also:
Constant Field Values

typeName

protected java.lang.String typeName
Constructor Detail

ContentDescriptor

public ContentDescriptor(java.lang.String cdName)
Create a content descriptor with the specified name.

To create a ContentDescriptor from a MIME type, use the mimeTypeToPackageName static member.

Parameters:
cdName - The name of the content-type.
Method Detail

getContentType

public java.lang.String getContentType()
Obtain a string that represents the content-name for this descriptor. It is identical to the string passed to the constructor.

Returns:
The content-type name.

mimeTypeToPackageName

public static final java.lang.String mimeTypeToPackageName(java.lang.String mimeType)
Map a MIME content-type to an equivalent string of class-name components.

The MIME type is mapped to a string by:

  1. Replacing all slashes with a period.
  2. Converting all alphabetic characters to lower case.
  3. Converting all non-alpha-numeric characters other than periods to underscores (_).

For example, "text/html" would be converted to "text.html"

Parameters:
mimeType - The MIME type to map to a string.

JSR-927 (Maintenance Release)

Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

For more information, please consult the JSR 927 specification.