|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wookie.w3c.util.ContentTypeUtils
public class ContentTypeUtils
Utils for content type sniffing
| Constructor Summary | |
|---|---|
ContentTypeUtils()
|
|
| Method Summary | |
|---|---|
static boolean |
isSupported(java.lang.String value,
java.lang.String[] supportedValues)
Checks to see if the supplied value is one of the supported values |
static boolean |
isSupportedImageType(java.io.File file)
Checks to see if a file is a supported image type |
static boolean |
isSupportedImageType(java.io.InputStream inputStream)
Checks to see if an inputstream contains a supported image type |
static boolean |
isSupportedImageType(java.lang.String filename)
Checks to see if a filename is a supported image type based on its file extension |
protected static java.lang.String |
sniffContentType(java.io.File file)
Sniffs the content type for images and other common types |
protected static java.lang.String |
sniffContentType(java.io.InputStream inputStream)
Sniffs the content type for images and other common types |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContentTypeUtils()
| Method Detail |
|---|
public static boolean isSupportedImageType(java.lang.String filename)
filename - the filename to check
public static boolean isSupportedImageType(java.io.File file)
file - the file to check
public static boolean isSupportedImageType(java.io.InputStream inputStream)
throws java.io.IOException
inputStream -
java.io.IOException
protected static java.lang.String sniffContentType(java.io.File file)
throws java.io.IOException
file - the file to sniff
java.io.IOException
protected static java.lang.String sniffContentType(java.io.InputStream inputStream)
throws java.io.IOException
inputStream - the inputStream to sniff
java.io.IOException
public static boolean isSupported(java.lang.String value,
java.lang.String[] supportedValues)
value - supportedValues -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||