com.j256.simplemagic
Class ContentType

java.lang.Object
  extended by com.j256.simplemagic.ContentType

public class ContentType
extends Object

Content-type associated with a file or bytes, returned by the magic matching code in ContentTypeUtil.findMatch(String) and other methods.

Author:
graywatson

Constructor Summary
ContentType(String name, String mimeType, String message)
           
 
Method Summary
 String getMessage()
          Returns the full message as generated by the magic matching code.
 String getMimeType()
          Returns the mime-type or null if none.
 String getName()
          Returns the short name of the content type.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentType

public ContentType(String name,
                   String mimeType,
                   String message)
Method Detail

getName

public String getName()
Returns the short name of the content type. Usually this is the first word of the first matching line from the magic file.


getMimeType

public String getMimeType()
Returns the mime-type or null if none.


getMessage

public String getMessage()
Returns the full message as generated by the magic matching code. This should be similar to the output from the Unix file(1) command.


toString

public String toString()
Overrides:
toString in class Object


This content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.