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