public interface MediaTypePredictor
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.MediaType |
getMediaTypeFromFile(File file)
Get the media type from a file name.
|
javax.ws.rs.core.MediaType |
getMediaTypeFromFileName(String fileName)
Get the media type from a file name.
|
javax.ws.rs.core.MediaType getMediaTypeFromFile(File file)
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)
javax.ws.rs.core.MediaType getMediaTypeFromFileName(String fileName)
MediaType
for
"*\/*", it will also return the same if the file is null
.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.Copyright © 2013 Oracle Corporation. All rights reserved.