Package org.faceless.publisher.type
Class Sniffer
java.lang.Object
org.faceless.publisher.type.Sniffer
The Sniffer is used to determine the Media-Type of a URL based on its
content if possible, or the filename in the URL if not
-
Method Summary
-
Method Details
-
sniff
Given a file at the specified path, sniff the file-type- Parameters:
path
- the path- Returns:
- the guessed MediaType or null if it's not recognised
- Throws:
IOException
-
sniff
Given a mark-capable InputStream, attempt to guess the MediaType. The stream is reset to its initial position at the end of this method.- Parameters:
in
- the InputStream, which must haveInputStream.markSupported()
return true- Returns:
- the guessed MediaType or null if it's not recognised
- Throws:
IOException
-