- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for guessContentTypeFromStream (0.09 sec)
-
src/main/java/org/codelibs/core/net/MimeTypeUtil.java
assertArgumentNotEmpty("path", path); final InputStream is = ResourceUtil.getResourceAsStream(path); try { final String mimetype = URLConnection.guessContentTypeFromStream(is); if (mimetype != null) { return mimetype; } return URLConnection.guessContentTypeFromName(path); } catch (final IOException e) {
Registered: Fri Nov 01 20:58:10 UTC 2024 - Last Modified: Thu Mar 07 01:59:08 UTC 2024 - 1.8K bytes - Viewed (0) -
src/test/java/org/codelibs/core/net/MimeTypeUtilTest.java
*/ @Test public void testGetFromPath() throws Exception { final String path = ClassUtil.getPackageName(this.getClass()).replaceAll("\\.", "/") + "/bbb.html"; final String s = URLConnection.guessContentTypeFromStream(ResourceUtil.getResourceAsStream(path)); assertNull(s); final String contentType = MimeTypeUtil.guessContentType(path); assertEquals("text/html", contentType); } /**
Registered: Fri Nov 01 20:58:10 UTC 2024 - Last Modified: Thu Mar 07 01:59:08 UTC 2024 - 2.7K bytes - Viewed (0)