Package io.milton.common
Class DefaultContentTypeService
- java.lang.Object
-
- io.milton.common.DefaultContentTypeService
-
- All Implemented Interfaces:
ContentTypeService
public class DefaultContentTypeService extends Object implements ContentTypeService
This implementation of ContentTypeService just uses a map of file extension to mime types. It supports multiple mimetypes per extension, but does not support qos. The default constructor reads a properties file /mime-types.properties, which should be a series of lines in the form: ext=contentType1,contentType2 Eg: arj=application/arj,application/octet-stream
-
-
Constructor Summary
Constructors Constructor Description DefaultContentTypeService()DefaultContentTypeService(Map<String,List<String>> mapOfContentTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>findContentTypes(String name)StringgetPreferedMimeType(String accept, List<String> canProvide)StringgetPreferedMimeType(List<String> accepts, List<String> canProvide)
-
-
-
Method Detail
-
findContentTypes
public List<String> findContentTypes(String name)
- Specified by:
findContentTypesin interfaceContentTypeService
-
getPreferedMimeType
public String getPreferedMimeType(String accept, List<String> canProvide)
- Specified by:
getPreferedMimeTypein interfaceContentTypeService
-
getPreferedMimeType
public String getPreferedMimeType(List<String> accepts, List<String> canProvide)
- Specified by:
getPreferedMimeTypein interfaceContentTypeService
-
-