@@ -1,6 +1,7 @@
|
||||
package com.imyeyu.compress;
|
||||
|
||||
import com.imyeyu.java.bean.CallbackArg;
|
||||
import com.imyeyu.java.bean.timi.TimiException;
|
||||
import com.imyeyu.utils.OS;
|
||||
|
||||
import java.io.File;
|
||||
@@ -11,7 +12,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* 抽象压缩执行器
|
||||
* 抽象处理器
|
||||
*
|
||||
* @param <T> 处理器类型
|
||||
* @author 夜雨
|
||||
@@ -273,16 +274,12 @@ public abstract class AbstractRunner<T extends AbstractRunner<T>> implements OS.
|
||||
* @return 规范化后的名称
|
||||
*/
|
||||
protected String normalizeEntryName(String entryName) {
|
||||
if (entryName == null || entryName.isBlank()) {
|
||||
throw new IllegalArgumentException("条目名称不能为空");
|
||||
}
|
||||
TimiException.required(entryName, "not found entryName");
|
||||
String normalized = entryName.replace('\\', '/');
|
||||
while (normalized.startsWith("/")) {
|
||||
normalized = normalized.substring(1);
|
||||
}
|
||||
if (normalized.isBlank()) {
|
||||
throw new IllegalArgumentException("条目名称不能为空");
|
||||
}
|
||||
TimiException.required(normalized, "not found normalized entryName");
|
||||
return normalized;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user