public class ContentTypeUtils
extends java.lang.Object
| Constructor and Description |
|---|
ContentTypeUtils() |
| Modifier and Type | Method and Description |
|---|---|
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
|
public static boolean isSupportedImageType(java.lang.String filename)
filename - the filename to checkpublic static boolean isSupportedImageType(java.io.File file)
file - the file to checkpublic static boolean isSupportedImageType(java.io.InputStream inputStream)
throws java.io.IOException
inputStream - java.io.IOExceptionprotected static java.lang.String sniffContentType(java.io.File file)
throws java.io.IOException
file - the file to sniffjava.io.IOExceptionprotected static java.lang.String sniffContentType(java.io.InputStream inputStream)
throws java.io.IOException
inputStream - the inputStream to sniffjava.io.IOExceptionpublic static boolean isSupported(java.lang.String value,
java.lang.String[] supportedValues)
value - supportedValues - 2012 Apache Software Foundation.