javax.media.protocol
Class ContentDescriptor

java.lang.Object
  extended by javax.media.protocol.ContentDescriptor

public class ContentDescriptor
extends Object

A ContentDescriptor identifies media data containers.

Version:
1.12, 05/10/24.
See Also:
SourceStream

Field Summary
static String CONTENT_UNKNOWN
           
protected  String typeName
           
 
Constructor Summary
ContentDescriptor(String cdName)
          Create a content descriptor with the specified name.
 
Method Summary
 String getContentType()
          Obtain a string that represents the content-name for this descriptor.
static String mimeTypeToPackageName(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 String CONTENT_UNKNOWN
See Also:
Constant Field Values

typeName

protected String typeName
Constructor Detail

ContentDescriptor

public ContentDescriptor(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 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 String mimeTypeToPackageName(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.


Copyright © 2011. All Rights Reserved.