|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.medsea.mimeutil.MimeType
eu.medsea.mimeutil.TextMimeType
public class TextMimeType
This class can be used to represent a mime type for a text file. This should only be returned by MimeDetector(s) that use magic number type matching. It allows for an encoding to be associated to a text type mime type such as text/plain.
| Constructor Summary | |
|---|---|
TextMimeType(MimeType mimeType)
Construct a new TestMimeType from an existing MimeType |
|
TextMimeType(String mimeType)
Construct a new TextMimeType from a string representation of a MimeType |
|
TextMimeType(String mimeType,
String encoding)
Construct a TextMimeType from a string representation of a MimeType and an encoding that should be one of the known encodings. |
|
| Method Summary | |
|---|---|
static void |
addKnownEncoding(String encoding)
Add a new encoding to the internal encodings this class knows about. |
String |
getEncoding()
Get the encoding currently set for this TextMimeType. |
Collection |
getKnownEncodings()
Get the list of currently known encodings. |
boolean |
isKnownEncoding(String encoding)
Utility method to see if the passed in encoding is known to this class. |
void |
setEncoding(String encoding)
Set the encoding used for the file or stream this MimeType is associated with |
| Methods inherited from class eu.medsea.mimeutil.MimeType |
|---|
compareTo, equals, getMediaType, getSpecificity, getSubType, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextMimeType(MimeType mimeType)
mimeType - public TextMimeType(String mimeType)
mimeType -
public TextMimeType(String mimeType,
String encoding)
mimeType - encoding - getKnownEncodings(),
addKnownEncoding(String)| Method Detail |
|---|
public Collection getKnownEncodings()
eu.medsea.mimeutil.TextEncodings. If a problem occurs
while reading this file a default hard coded set of encodings are used.
New encodings can be added to the known encodings usingsetEncoding(String)
setEncoding(String)public static void addKnownEncoding(String encoding)
encoding - getKnownEncodings()public String getEncoding()
getKnownEncodings(),
setEncoding(String)public void setEncoding(String encoding)
encoding - public boolean isKnownEncoding(String encoding)
encoding -
getKnownEncodings()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||