Created by zl on 2019/03/01.
| 11 | * Created by zl on 2019/03/01. |
| 12 | */ |
| 13 | @Slf4j |
| 14 | public class MimeTypeUtil { |
| 15 | static { |
| 16 | MimeUtil.registerMimeDetector("eu.medsea.mimeutil.detector.MagicMimeMimeDetector"); |
| 17 | } |
| 18 | |
| 19 | public static String getTypes(String fileName) { |
| 20 | if(fileName.endsWith(".html")){ |
| 21 | return DEFAULT_CONTENT_TYPE; |
| 22 | } |
| 23 | Collection mimeTypes = MimeUtil.getMimeTypes(MimeTypeUtil.class.getResource(fileName)); |
| 24 | return mimeTypes.toArray()[0].toString(); |
| 25 | } |
| 26 | |
| 27 | } |
nothing calls this directly
no outgoing calls
no test coverage detected