|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tika.mime.MimeType
public final class MimeType
Internet media type.
Method Summary | |
---|---|
void |
addAlias(java.lang.String alias)
Adds an alias name for this media type. |
int |
compareTo(MimeType type)
|
java.lang.String |
getDescription()
Returns the description of this media type. |
java.lang.String |
getName()
Returns the name of this media type. |
MimeType |
getSuperType()
Returns the parent of this media type. |
boolean |
hasMagic()
|
boolean |
isDescendantOf(MimeType type)
|
static boolean |
isValid(java.lang.String name)
Checks that the given string is a valid Internet media type name based on rules from RFC 2054 section 5.3. |
boolean |
matches(byte[] data)
|
boolean |
matchesMagic(byte[] data)
|
void |
setDescription(java.lang.String description)
Set the description of this media type. |
void |
setSuperType(MimeType type)
|
java.lang.String |
toString()
Returns the name of this media type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static boolean isValid(java.lang.String name)
name := token "/" token token := 1*<any (US-ASCII) CHAR except SPACE, CTLs, or tspecials> tspecials := "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" / <"> / "/" / "[" / "]" / "?" / "="
name
- name string
true
if the string is a valid media type name,
false
otherwisepublic java.lang.String getName()
public MimeType getSuperType()
null
public void setSuperType(MimeType type) throws MimeTypeException
MimeTypeException
public boolean isDescendantOf(MimeType type)
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- media type descriptionpublic void addAlias(java.lang.String alias) throws MimeTypeException
alias
- media type alias (case insensitive)
MimeTypeException
- if the alias is invalid or
already registered for another media typepublic boolean hasMagic()
public boolean matchesMagic(byte[] data)
public boolean matches(byte[] data)
public int compareTo(MimeType type)
compareTo
in interface java.lang.Comparable<MimeType>
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |