eu.medsea.mimeutil
Class TextMimeType

java.lang.Object
  extended by eu.medsea.mimeutil.MimeType
      extended by eu.medsea.mimeutil.TextMimeType
All Implemented Interfaces:
Serializable, Comparable

public class TextMimeType
extends MimeType

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.

Author:
Steven McArdle
See Also:
Serialized Form

Field Summary
 
Fields inherited from class eu.medsea.mimeutil.MimeType
mediaType, subType
 
Constructor Summary
TextMimeType(MimeType mimeType)
           
TextMimeType(MimeType mimeType, String encoding)
           
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
 String getEncoding()
          Get the encoding currently set for this TextMimeType.
 void setEncoding(String encoding)
           
 void setMediaType(String mediaType)
           
 void setMimeType(MimeType mimeType)
           
 void setSubType(String subType)
           
 String toString()
          Overrides the toString method of java.lang.Object.
 
Methods inherited from class eu.medsea.mimeutil.MimeType
compareTo, equals, getMediaType, getSpecificity, getSubType, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextMimeType

public 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.

Parameters:
mimeType -
encoding -
See Also:
#getKnownEncodings(), #addKnownEncoding(String)

TextMimeType

public TextMimeType(MimeType mimeType,
                    String encoding)

TextMimeType

public TextMimeType(MimeType mimeType)
Method Detail

setMimeType

public void setMimeType(MimeType mimeType)

getEncoding

public String getEncoding()
Get the encoding currently set for this TextMimeType.

Returns:
the encoding as a string
See Also:
#getKnownEncodings(), setEncoding(String)

setEncoding

public void setEncoding(String encoding)

toString

public String toString()
Description copied from class: MimeType
Overrides the toString method of java.lang.Object.

Overrides:
toString in class MimeType
Returns:
String representation i.e. <media type>/<sub type>.
See Also:
Object.toString()

setMediaType

public void setMediaType(String mediaType)

setSubType

public void setSubType(String subType)


Copyright © 2007-2010 Medsea Business Solutions S.L.. All Rights Reserved.