diff --git a/CHANGELOG.md b/CHANGELOG.md index 1245c5736..10ce28ca7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 7.2.18 (2018-12-17) +## 修正 +* 分片上传重试添加 crc32 校验 +* pili stream 管理,参数 json 格式 + ## 7.2.15 (2018-09-10) ## 移除内部鉴权打印 diff --git a/src/main/java/com/qiniu/common/Constants.java b/src/main/java/com/qiniu/common/Constants.java index cf539e252..d770cce4b 100644 --- a/src/main/java/com/qiniu/common/Constants.java +++ b/src/main/java/com/qiniu/common/Constants.java @@ -9,7 +9,7 @@ public final class Constants { /** * 版本号 */ - public static final String VERSION = "7.2.17"; + public static final String VERSION = "7.2.18"; /** * 块大小,不能改变 */ diff --git a/src/main/java/com/qiniu/common/QiniuException.java b/src/main/java/com/qiniu/common/QiniuException.java index ac72a2e70..6f856505e 100644 --- a/src/main/java/com/qiniu/common/QiniuException.java +++ b/src/main/java/com/qiniu/common/QiniuException.java @@ -16,6 +16,9 @@ public final class QiniuException extends IOException { public QiniuException(Response response) { super(response != null ? response.getInfo() : null); this.response = response; + if (response != null) { + response.close(); + } } public QiniuException(Exception e) { diff --git a/src/main/java/com/qiniu/storage/BucketManager.java b/src/main/java/com/qiniu/storage/BucketManager.java index 3153af36e..1befa85fe 100644 --- a/src/main/java/com/qiniu/storage/BucketManager.java +++ b/src/main/java/com/qiniu/storage/BucketManager.java @@ -8,6 +8,7 @@ import com.qiniu.http.Response; import com.qiniu.storage.model.*; import com.qiniu.util.*; + import java.util.*; /** @@ -326,7 +327,7 @@ public Response changeType(String bucket, String key, StorageType type) * * @param bucket 空间名称 * @param key 文件名称 - * @param status 0表示启用;1表示禁用。 + * @param status 0表示启用;1表示禁用。 * @throws QiniuException */ public Response changeStatus(String bucket, String key, int status) diff --git a/src/main/java/com/qiniu/streaming/StreamingManager.java b/src/main/java/com/qiniu/streaming/StreamingManager.java index 51d1ceb84..b8266d719 100644 --- a/src/main/java/com/qiniu/streaming/StreamingManager.java +++ b/src/main/java/com/qiniu/streaming/StreamingManager.java @@ -164,7 +164,8 @@ public String saveAs(String streamKey, String fileName, long start, long end) th * @param end 录制结束的时间戳,单位秒 * @param other 文档中指定的其它参数 */ - public String saveAs(String streamKey, String fileName, long start, long end, StringMap other) throws QiniuException { + public String saveAs(String streamKey, String fileName, long start, long end, StringMap other) + throws QiniuException { String path = encodeKey(streamKey) + "/saveas"; StringMap param = other != null ? other : new StringMap(); param.putNotEmpty("fname", fileName).put("start", start).put("end", end); diff --git a/src/test/java/test/com/qiniu/rtc/RtcTest.java b/src/test/java/test/com/qiniu/rtc/RtcTest.java index 30000a306..4643a063d 100644 --- a/src/test/java/test/com/qiniu/rtc/RtcTest.java +++ b/src/test/java/test/com/qiniu/rtc/RtcTest.java @@ -10,18 +10,7 @@ public class RtcTest { - private String ak = "DXFtikq1YuD"; //AccessKey you get from qiniu - private String sk = "F397hz"; //SecretKey you get from qiniu - private Auth auth = null; - - { - try { - auth = Auth.create(ak, sk); - } catch (Exception e) { - auth = TestConfig.testAuth; - } - } - + private Auth auth = TestConfig.testAuth; private RtcAppManager manager = new RtcAppManager(auth); private RtcRoomManager rmanager = new RtcRoomManager(auth); diff --git a/src/test/java/test/com/qiniu/storage/BucketTest.java b/src/test/java/test/com/qiniu/storage/BucketTest.java index 5532a5599..83356ba61 100644 --- a/src/test/java/test/com/qiniu/storage/BucketTest.java +++ b/src/test/java/test/com/qiniu/storage/BucketTest.java @@ -29,7 +29,7 @@ public class BucketTest { }; @Before - protected void setUp() throws Exception { + public void setUp() throws Exception { //default config Configuration cfg = new Configuration(); cfg.useHttpsDomains = false; diff --git a/src/test/java/test/com/qiniu/streaming/StreamingTest.java b/src/test/java/test/com/qiniu/streaming/StreamingTest.java index 1c2e70ddd..74ff2d989 100644 --- a/src/test/java/test/com/qiniu/streaming/StreamingTest.java +++ b/src/test/java/test/com/qiniu/streaming/StreamingTest.java @@ -18,15 +18,7 @@ * Created by bailong on 16/9/22 */ public class StreamingTest { - private Auth auth = null; - - { - try { - auth = Auth.create(System.getenv("ak"), System.getenv("sk")); - } catch (Exception e) { - auth = TestConfig.testAuth; - } - } + private Auth auth = TestConfig.testAuth; private String hub = "pilisdktest"; private String streamKeyPrefix = "pilijava" + System.currentTimeMillis();