mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-08-18 20:38:02 +08:00
add mime support
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package cn.hutool.core.io.file;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
@@ -65,4 +66,16 @@ public class PathUtilTest {
|
||||
mimeType = PathUtil.getMimeType(Paths.get("d:/test/test.mov"));
|
||||
Assert.assertEquals("video/quicktime", mimeType);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMimeOfRarTest(){
|
||||
String contentType = FileUtil.getMimeType("a001.rar");
|
||||
Assert.assertEquals("application/x-rar-compressed", contentType);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMimeOf7zTest(){
|
||||
String contentType = FileUtil.getMimeType("a001.7z");
|
||||
Assert.assertEquals("application/x-7z-compressed", contentType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user