public static String getMimeType(String filePath) {
		if (StrUtil.isBlank(filePath)) {
			return null;
		}

		// 补充一些常用的mimeType
		if (StrUtil.endWithIgnoreCase(filePath, ".css")) {
			return "text/css";
		} else if (StrUtil.endWithIgnoreCase(filePath, ".js")) {
			return "application/x-javascript";
		} else if (StrUtil.endWithIgnoreCase(filePath, ".rar")) {
			return "application/x-rar-compressed";
		} else if (StrUtil.endWithIgnoreCase(filePath, ".7z")) {
			return "application/x-7z-compressed";
		} else if (StrUtil.endWithIgnoreCase(filePath, ".wgt")) {
			return "application/widget";
		} else if (StrUtil.endWithIgnoreCase(filePath, ".webp")) {
			// JDK8不支持
			return "image/webp";
		}

		String contentType = URLConnection.getFileNameMap().getContentTypeFor(filePath);
		if (null == contentType) {
			contentType = getMimeType(Paths.get(filePath));
		}

		return contentType;
	}
@Test
	public void getMimeTypeTest() {
		String mimeType = FileUtil.getMimeType("test2Write.jpg");
		assertEquals("image/jpeg", mimeType);

		mimeType = FileUtil.getMimeType("test2Write.html");
		assertEquals("text/html", mimeType);

		mimeType = FileUtil.getMimeType("main.css");
		assertEquals("text/css", mimeType);

		mimeType = FileUtil.getMimeType("test.js");
		// 在 jdk 11+ 会获取到 text/javascript,而非 自定义的 application/x-javascript
		final List<String> list = ListUtil.of("text/javascript", "application/x-javascript");
		assertTrue(list.contains(mimeType));

		// office03
		mimeType = FileUtil.getMimeType("test.doc");
		assertEquals("application/msword", mimeType);
		mimeType = FileUtil.getMimeType("test.xls");
		assertEquals("application/vnd.ms-excel", mimeType);
		mimeType = FileUtil.getMimeType("test.ppt");
		assertEquals("application/vnd.ms-powerpoint", mimeType);

		// office07+
		mimeType = FileUtil.getMimeType("test.docx");
		assertEquals("application/vnd.openxmlformats-officedocument.wordprocessingml.document", mimeType);
		mimeType = FileUtil.getMimeType("test.xlsx");
		assertEquals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", mimeType);
		mimeType = FileUtil.getMimeType("test.pptx");
		assertEquals("application/vnd.openxmlformats-officedocument.presentationml.presentation", mimeType);

		// pr#2617@Github
		mimeType = FileUtil.getMimeType("test.wgt");
		assertEquals("application/widget", mimeType);

		// issue#3092
		mimeType = FileUtil.getMimeType("https://xxx.oss-cn-hangzhou.aliyuncs.com/xxx.webp");
		assertEquals("image/webp", mimeType);
	}