MCPcopy Create free account
hub / github.com/defineYIDA/LWebServer / MimeTypeUtil

Class MimeTypeUtil

src/main/java/cn/lws/server/util/MimeTypeUtil.java:13–27  ·  view source on GitHub ↗

Created by zl on 2019/03/01.

Source from the content-addressed store, hash-verified

11 * Created by zl on 2019/03/01.
12 */
13@Slf4j
14public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected