Merge pull request 'v0.1.0' (#7) from dev into master
Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.imyeyu.io</groupId>
|
<groupId>com.imyeyu.io</groupId>
|
||||||
<artifactId>timi-io</artifactId>
|
<artifactId>timi-io</artifactId>
|
||||||
<version>0.0.7</version>
|
<version>0.1.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.imyeyu.utils</groupId>
|
<groupId>com.imyeyu.utils</groupId>
|
||||||
<artifactId>timi-utils</artifactId>
|
<artifactId>timi-utils</artifactId>
|
||||||
<version>0.0.14</version>
|
<version>0.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package com.imyeyu.io;
|
package com.imyeyu.io;
|
||||||
|
|
||||||
import com.imyeyu.java.TimiJava;
|
import com.imyeyu.java.TimiJava;
|
||||||
|
import com.imyeyu.java.bean.ActionException;
|
||||||
import com.imyeyu.java.bean.Callback;
|
import com.imyeyu.java.bean.Callback;
|
||||||
import com.imyeyu.java.bean.CallbackArg;
|
import com.imyeyu.java.bean.CallbackArg;
|
||||||
import com.imyeyu.java.bean.timi.TimiCode;
|
import com.imyeyu.java.bean.ResultCode;
|
||||||
import com.imyeyu.java.bean.timi.TimiException;
|
|
||||||
import com.imyeyu.utils.Decoder;
|
import com.imyeyu.utils.Decoder;
|
||||||
import com.imyeyu.utils.OS;
|
import com.imyeyu.utils.OS;
|
||||||
import com.imyeyu.utils.Text;
|
import com.imyeyu.utils.Text;
|
||||||
@@ -233,7 +233,7 @@ public class IO implements OS.FileSystem {
|
|||||||
if (file.renameTo(resultFile) && resultFile.exists()) {
|
if (file.renameTo(resultFile) && resultFile.exists()) {
|
||||||
return resultFile;
|
return resultFile;
|
||||||
}
|
}
|
||||||
throw new TimiException(TimiCode.RESULT_BAD, "rename file fail: from " + file.getAbsolutePath() + ", to " + resultFile.getAbsolutePath());
|
throw new ActionException(ResultCode.RESULT_BAD, "rename file fail: from " + file.getAbsolutePath() + ", to " + resultFile.getAbsolutePath());
|
||||||
} else {
|
} else {
|
||||||
String msg = "Illeagl file name: %s, not allow char: %s";
|
String msg = "Illeagl file name: %s, not allow char: %s";
|
||||||
if (OS.IS_WINDOWS) {
|
if (OS.IS_WINDOWS) {
|
||||||
@@ -661,7 +661,7 @@ public class IO implements OS.FileSystem {
|
|||||||
public static void toOutputStream(InputStream is, OutputStream os, long start, long end) throws IOException {
|
public static void toOutputStream(InputStream is, OutputStream os, long start, long end) throws IOException {
|
||||||
long skip = is.skip(start);
|
long skip = is.skip(start);
|
||||||
if (skip != start) {
|
if (skip != start) {
|
||||||
throw new TimiException(TimiCode.ERROR, "skip fail");
|
throw new ActionException(ResultCode.ERROR, "skip fail");
|
||||||
}
|
}
|
||||||
byte[] buffer = new byte[8192];
|
byte[] buffer = new byte[8192];
|
||||||
long remaining = end - start + 1;
|
long remaining = end - start + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user