|
@@ -85,6 +85,36 @@ public final class FileCheckRuleConfig {
|
|
|
"application/x-msdownload"
|
|
"application/x-msdownload"
|
|
|
)
|
|
)
|
|
|
.build();
|
|
.build();
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 压缩包规则
|
|
|
|
|
+ */
|
|
|
|
|
+ public static final FileCheckRuleConfig ARCHIVE = builder()
|
|
|
|
|
+ .withExtensions(
|
|
|
|
|
+ "zip", "rar", "7z", "tar", "gz", "bz2", "xz",
|
|
|
|
|
+ "jar", "war", "ear", // Java 归档文件
|
|
|
|
|
+ "cab", // Windows 归档文件
|
|
|
|
|
+ "iso", // 光盘映像文件
|
|
|
|
|
+ "dmg", // macOS 磁盘映像
|
|
|
|
|
+ "apk", // Android 应用包
|
|
|
|
|
+ "msi" // Windows 安装包
|
|
|
|
|
+ )
|
|
|
|
|
+ .withMimeTypes(
|
|
|
|
|
+ "application/zip",
|
|
|
|
|
+ "application/x-rar-compressed",
|
|
|
|
|
+ "application/x-7z-compressed",
|
|
|
|
|
+ "application/x-tar",
|
|
|
|
|
+ "application/gzip",
|
|
|
|
|
+ "application/x-bzip2",
|
|
|
|
|
+ "application/x-xz",
|
|
|
|
|
+ "application/java-archive",
|
|
|
|
|
+ "application/vnd.ms-cab-compressed",
|
|
|
|
|
+ "application/x-iso9660-image",
|
|
|
|
|
+ "application/x-apple-diskimage",
|
|
|
|
|
+ "application/vnd.android.package-archive",
|
|
|
|
|
+ "application/x-msdownload"
|
|
|
|
|
+ )
|
|
|
|
|
+ .build();
|
|
|
// /**
|
|
// /**
|
|
|
// * 特殊文件类型规则
|
|
// * 特殊文件类型规则
|
|
|
// */
|
|
// */
|
|
@@ -111,7 +141,7 @@ public final class FileCheckRuleConfig {
|
|
|
/**
|
|
/**
|
|
|
* 所有类型规则
|
|
* 所有类型规则
|
|
|
*/
|
|
*/
|
|
|
- public static final FileCheckRuleConfig ALL = combine(IMAGE, VIDEO, AUDIO, DOCUMENT);
|
|
|
|
|
|
|
+ public static final FileCheckRuleConfig ALL = combine(IMAGE, VIDEO, AUDIO, DOCUMENT, ARCHIVE);
|
|
|
|
|
|
|
|
private final Set<String> allowedExtensions;
|
|
private final Set<String> allowedExtensions;
|
|
|
private final Set<String> allowedMimeTypes;
|
|
private final Set<String> allowedMimeTypes;
|