mirror of
https://git.victorphan.net/basketballcantho/Teedy_custom.git
synced 2026-08-05 22:03:11 +07:00
test the new mime type detection
This commit is contained in:
@@ -27,7 +27,8 @@ public class MimeTypeUtil {
|
||||
* @throws IOException e
|
||||
*/
|
||||
public static String guessMimeType(Path file, String name) throws IOException {
|
||||
String mimeType = URLConnection.getFileNameMap().getContentTypeFor(name);
|
||||
String mimeType = name == null ?
|
||||
null : URLConnection.getFileNameMap().getContentTypeFor(name);
|
||||
if (mimeType == null) {
|
||||
try (InputStream is = Files.newInputStream(file)) {
|
||||
final byte[] headerBytes = new byte[64];
|
||||
|
||||
Reference in New Issue
Block a user