com.j256.simplemagic
Class ContentInfo

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

public class ContentInfo
extends Object

Information associated with some content, returned by the magic matching code in ContentInfoUtil.findMatch(String) and other methods.

Author:
graywatson

Constructor Summary
ContentInfo(String name, String mimeType, String message)
           
 
Method Summary
 ContentType getContentType()
          Returns the internal enumerated type associated with the content or ContentType.OTHER if not known.
 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 either from the content-type or extracted from the message.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentInfo

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

getContentType

public ContentType getContentType()
Returns the internal enumerated type associated with the content or ContentType.OTHER if not known.


getName

public String getName()
Returns the short name of the content either from the content-type or extracted from the message. If the content-type is known then this is a specific name string. Otherwise this is usually the first word of the message generated by 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.