|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jersey.multipart.file.DefaultMediaTypePredictor
public class DefaultMediaTypePredictor
Default implementation of MediaTypePredictor
that uses
DefaultMediaTypePredictor.CommonMediaTypes
.
Nested Class Summary | |
---|---|
static class |
DefaultMediaTypePredictor.CommonMediaTypes
This enum represents file extension and MIME types of commonly used file. |
Constructor Summary | |
---|---|
DefaultMediaTypePredictor()
|
Method Summary | |
---|---|
static DefaultMediaTypePredictor |
getInstance()
Get the singleton instance of this class. |
MediaType |
getMediaTypeFromFile(File file)
Get the media type from a file name. |
MediaType |
getMediaTypeFromFileName(String fileName)
Get the media type from a file name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultMediaTypePredictor()
Method Detail |
---|
public MediaType getMediaTypeFromFile(File file)
MediaTypePredictor
getMediaTypeFromFile
in interface MediaTypePredictor
file
- The file from which to get the MediaType
MediaType
for the give file; null
- if file
is null; "application/octet-stream" if extension not recognized.DefaultMediaTypePredictor.CommonMediaTypes.getMediaTypeFromFileName(java.lang.String)
public MediaType getMediaTypeFromFileName(String fileName)
MediaTypePredictor
MediaType
for
"*\/*", it will also return the same if the file is null
.
getMediaTypeFromFileName
in interface MediaTypePredictor
fileName
- The file name from which to get the MediaType
MediaType
for the give file; null
- if file
is null; "application/octet-stream" if extension not recognized.public static DefaultMediaTypePredictor getInstance()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |