Skip to content

Commit 4f60953

Browse files
author
hicooper
committed
test pass
1 parent 58bc291 commit 4f60953

File tree

4 files changed

+38
-27
lines changed

4 files changed

+38
-27
lines changed

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Mon Sep 02 12:37:17 CST 2019
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
2+
distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip
33
distributionBase=GRADLE_USER_HOME
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists

src/main/java/com/berry/http/HttpClient.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,10 @@ public Response multipartPost(String url,
209209
public Response multipartPost(String url,
210210
StringMap fields,
211211
String name,
212-
String fileName,
213212
File fileBody,
214213
StringMap headers) throws OssException {
215214
RequestBody file = RequestBody.create(MediaType.parse(Constants.MULTIPART_MIME), fileBody);
216-
Request.Builder requestBuilder = getBuilder(url, fields, name, fileName, file);
215+
Request.Builder requestBuilder = getBuilder(url, fields, name, fileBody.getName(), file);
217216
return send(requestBuilder, headers);
218217
}
219218

@@ -349,7 +348,7 @@ private static Response send(final Request.Builder requestBuilder, @Nullable Str
349348
response.close();
350349
logger.error("request fail,stateCode:{}, msg:{}", code, msg);
351350
}
352-
} catch (IOException e) {
351+
} catch (Exception e) {
353352
throw new OssException(e.getMessage());
354353
}
355354
return Response.create(response, null);

src/main/java/com/berry/storage/ObjectManage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public ObjectInfo upload(String bucket, String acl, @Nullable String filePath, S
8080
* @param filePath 对象存储路径
8181
* @param files 文件
8282
*/
83-
public JSONArray upload(String bucket, String acl, @Nullable String filePath, File[] files) throws OssException {
83+
public JSONArray upload(String bucket, String acl, @Nullable String filePath, File files) throws OssException {
8484
// 验证acl 规范
8585
if (!Constants.AclType.ALL_NAME.contains(acl)) {
8686
throw new IllegalArgumentException("illegal acl, enum [" + Constants.AclType.ALL_NAME + "]");

src/test/java/com/berry/StorageTest.java

Lines changed: 34 additions & 22 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)