Interface MediaTypePredictor
- All Known Implementing Classes:
DefaultMediaTypePredictor
public interface MediaTypePredictor
An interface which allows developers implement their own media type predictor.
-
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.MediaTypegetMediaTypeFromFile(File file) Get the media type from a file name.javax.ws.rs.core.MediaTypegetMediaTypeFromFileName(String fileName) Get the media type from a file name.
-
Method Details
-
getMediaTypeFromFile
Get the media type from a file name.- Parameters:
file- the file from which to get theMediaType.- Returns:
- the
MediaTypefor the give file;null- if file is null; "application/octet-stream" if extension not recognized. - See Also:
-
getMediaTypeFromFileName
Get the media type from a file name. If the file name extension is not recognised it will returnMediaTypefor "*\/*", it will also return the same if the file isnull.- Parameters:
fileName- the file name from which to get theMediaType.- Returns:
- the
MediaTypefor the give file;null- if file is null; "application/octet-stream" if extension not recognized.
-