Skip to content

Commit 78fd836

Browse files
committed
format
1 parent 5c22cc4 commit 78fd836

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

src/main/java/com/qiniu/common/Constants.java

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,30 @@
55
/**
66
* Created by bailong on 16/9/14.
77
*/
8-
public interface Constants {
9-
String VERSION = "8.0.0";
10-
int BLOCK_SIZE = 4 * 1024 * 1024;
11-
Charset UTF_8 = Charset.forName("UTF-8");
8+
public final class Constants {
9+
/**
10+
* 版本号
11+
*/
12+
public static final String VERSION = "8.0.0";
13+
/**
14+
* 块大小,不能改变
15+
*/
16+
public static final int BLOCK_SIZE = 4 * 1024 * 1024;
17+
/**
18+
* 所有都是UTF-8编码
19+
*/
20+
public static final Charset UTF_8 = Charset.forName("UTF-8");
1221
/**
1322
* 连接超时时间 单位秒(默认10s)
1423
*/
15-
public int CONNECT_TIMEOUT = 10;
24+
public static final int CONNECT_TIMEOUT = 10;
1625
/**
1726
* 写超时时间 单位秒(默认 0 , 不超时)
1827
*/
19-
public int WRITE_TIMEOUT = 0;
28+
public static final int WRITE_TIMEOUT = 0;
2029
/**
2130
* 回复超时时间 单位秒(默认30s)
2231
*/
23-
public int RESPONSE_TIMEOUT = 30;
32+
public static final int RESPONSE_TIMEOUT = 30;
2433
}
2534

src/main/java/com/qiniu/storage/Configuration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public final class Configuration implements Cloneable {
3737
/**
3838
* 上传失败重试次数
3939
*/
40-
public int RETRY_MAX = 5;
40+
public int retryMax = 5;
4141
/**
4242
* 外部dns
4343
*/

src/main/java/com/qiniu/storage/FormUploader.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ private FormUploader(Client client, String upToken, String key, byte[] data, Fil
5050
Response upload() throws QiniuException {
5151
buildParams();
5252
if (data != null) {
53-
return client.multipartPost(configuration.zone.upHost(token), params, "file", fileName, data, mime, new StringMap());
53+
return client.multipartPost(configuration.zone.upHost(token), params, "file", fileName, data,
54+
mime, new StringMap());
5455
}
55-
return client.multipartPost(configuration.zone.upHost(token), params, "file", fileName, file, mime, new StringMap());
56+
return client.multipartPost(configuration.zone.upHost(token), params, "file", fileName, file,
57+
mime, new StringMap());
5658
}
5759

5860
void asyncUpload(final UpCompletionHandler handler) throws IOException {

0 commit comments

Comments
 (0)