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 © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.