|
||||||||||
| 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(java.io.File file)
Get the media type from a file name. |
MediaType |
getMediaTypeFromFileName(java.lang.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(java.io.File file)
MediaTypePredictor
getMediaTypeFromFile in interface MediaTypePredictorfile - 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(java.lang.String fileName)
MediaTypePredictorMediaType for
"*\/*", it will also return the same if the file is null.
getMediaTypeFromFileName in interface MediaTypePredictorfileName - 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 | |||||||||