@Test void testCustom() { Optional<String> hocon = MediaTypes.detectExtensionType("json"); assertThat(hocon, is(Optional.of("application/hocon"))); }
public static Optional<String> detectExtensionType(String fileSuffix) { return CACHE.computeIfAbsent(fileSuffix, it -> DETECTORS.stream() .map(mtd -> mtd.detectExtensionType(fileSuffix)) .flatMap(Optional::stream) .findFirst()); }
MediaTypes { public static Optional<String> detectExtensionType(String fileSuffix) { return CACHE.computeIfAbsent(fileSuffix, it -> DETECTORS.stream() .map(mtd -> mtd.detectExtensionType(fileSuffix)) .flatMap(Optional::stream) .findFirst()); } }
MediaTypes { public static Optional<String> detectExtensionType(String fileSuffix) { return CACHE.computeIfAbsent(fileSuffix, it -> DETECTORS.stream() .map(mtd -> mtd.detectExtensionType(fileSuffix)) .flatMap(Optional::stream) .findFirst()); } private  MediaTypes(); }
MediaTypes { public static Optional<String> detectExtensionType(String fileSuffix) { return CACHE.computeIfAbsent(fileSuffix, it -> DETECTORS.stream() .map(mtd -> mtd.detectExtensionType(fileSuffix)) .flatMap(Optional::stream) .findFirst()); } private  MediaTypes(); static Optional<String> detectType(URL url); static Optional<String> detectType(URI uri); static Optional<String> detectType(Path file); static Optional<String> detectType(String fileName); static Optional<String> detectExtensionType(String fileSuffix); }
MediaTypes { public static Optional<String> detectExtensionType(String fileSuffix) { return CACHE.computeIfAbsent(fileSuffix, it -> DETECTORS.stream() .map(mtd -> mtd.detectExtensionType(fileSuffix)) .flatMap(Optional::stream) .findFirst()); } private  MediaTypes(); static Optional<String> detectType(URL url); static Optional<String> detectType(URI uri); static Optional<String> detectType(Path file); static Optional<String> detectType(String fileName); static Optional<String> detectExtensionType(String fileSuffix);  }