@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.imyeyu.compress</groupId>
|
||||
<artifactId>timi-compress</artifactId>
|
||||
<version>0.0.5</version>
|
||||
<version>0.1.0</version>
|
||||
|
||||
<properties>
|
||||
<java.version>21</java.version>
|
||||
@@ -91,7 +91,7 @@
|
||||
<dependency>
|
||||
<groupId>com.imyeyu.io</groupId>
|
||||
<artifactId>timi-io</artifactId>
|
||||
<version>0.0.5</version>
|
||||
<version>0.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.imyeyu.compress;
|
||||
|
||||
import com.imyeyu.java.bean.ActionException;
|
||||
import com.imyeyu.java.bean.CallbackArg;
|
||||
import com.imyeyu.java.bean.timi.TimiException;
|
||||
import com.imyeyu.utils.OS;
|
||||
|
||||
import java.io.File;
|
||||
@@ -274,12 +274,12 @@ public abstract class AbstractRunner<T extends AbstractRunner<T>> implements OS.
|
||||
* @return 规范化后的名称
|
||||
*/
|
||||
protected String normalizeEntryName(String entryName) {
|
||||
TimiException.required(entryName, "not found entryName");
|
||||
ActionException.required(entryName, "not found entryName");
|
||||
String normalized = entryName.replace('\\', '/');
|
||||
while (normalized.startsWith("/")) {
|
||||
normalized = normalized.substring(1);
|
||||
}
|
||||
TimiException.required(normalized, "not found normalized entryName");
|
||||
ActionException.required(normalized, "not found normalized entryName");
|
||||
return normalized;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.imyeyu.compress;
|
||||
|
||||
import com.imyeyu.io.IO;
|
||||
import com.imyeyu.java.bean.timi.TimiException;
|
||||
import com.imyeyu.java.bean.ActionException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.OutputStream;
|
||||
@@ -25,7 +25,7 @@ public abstract class Compressor<T extends Compressor<T>> extends AbstractRunner
|
||||
* @return 当前压缩器
|
||||
*/
|
||||
protected T of(String fromPath) {
|
||||
TimiException.required(fromPath, "not found fromPath");
|
||||
ActionException.required(fromPath, "not found fromPath");
|
||||
this.fromPath = fromPath;
|
||||
return self();
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public abstract class Compressor<T extends Compressor<T>> extends AbstractRunner
|
||||
* @return 当前压缩器
|
||||
*/
|
||||
protected T of(File fromFile) {
|
||||
TimiException.required(fromFile, "not found fromFile");
|
||||
ActionException.required(fromFile, "not found fromFile");
|
||||
return of(fromFile.getAbsolutePath());
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public abstract class Compressor<T extends Compressor<T>> extends AbstractRunner
|
||||
* @return 源路径
|
||||
*/
|
||||
protected String requireFromPath() {
|
||||
TimiException.required(fromPath, "not found source");
|
||||
ActionException.required(fromPath, "not found source");
|
||||
return fromPath;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.imyeyu.compress;
|
||||
|
||||
import com.imyeyu.io.IO;
|
||||
import com.imyeyu.java.bean.timi.TimiException;
|
||||
import com.imyeyu.java.bean.ActionException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
@@ -28,7 +28,7 @@ public abstract class Decompressor<T extends Decompressor<T>> extends AbstractRu
|
||||
* @return 当前解压器
|
||||
*/
|
||||
protected T of(File fromFile) {
|
||||
TimiException.required(fromFile, "not found fromFile");
|
||||
ActionException.required(fromFile, "not found fromFile");
|
||||
this.fromFile = fromFile;
|
||||
this.fromStream = null;
|
||||
return self();
|
||||
@@ -41,7 +41,7 @@ public abstract class Decompressor<T extends Decompressor<T>> extends AbstractRu
|
||||
* @return 当前解压器
|
||||
*/
|
||||
protected T of(String fromPath) {
|
||||
TimiException.required(fromPath, "not found fromPath");
|
||||
ActionException.required(fromPath, "not found fromPath");
|
||||
return of(new File(fromPath));
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class Decompressor<T extends Decompressor<T>> extends AbstractRu
|
||||
* @return 当前解压器
|
||||
*/
|
||||
public T of(InputStream fromStream) {
|
||||
TimiException.required(fromStream, "not found fromStream");
|
||||
ActionException.required(fromStream, "not found fromStream");
|
||||
this.fromStream = fromStream;
|
||||
this.fromFile = null;
|
||||
return self();
|
||||
|
||||
Reference in New Issue
Block a user