All notable changes to QingStor SDK for JAVA will be documented in this file.
- Fix auto set content-disposition in upload manager
- Fix Boolean values in Model are always null
- Update listObjects method
To add the objectKey in the callbacks of UploadManager, there are some changes below:
- UploadManagerCallback.onAPIResponse(OutputModel outputModel) => UploadManagerCallback.onAPIResponse(String objectKey, OutputModel outputModel)
- BodyProgressListener in UploadManager => UploadProgressListener
Add a construction method of QingStor.java
- Fix signature not match error
-
Modify the http response header key to lower case
Now some http response headers have become lowercase, were uppercase before("X-QS-Encryption-Customer-Algorithm" --> "x-qs-encryption-customer-algorithm"). To fix this issue, http headers in SDK are case insensitive.
-
Add has_more in response element
If you are a private cloud user, please ensure that the version number of your server is greater than 20180801 (inclusive).
- Modify the class EvnContext to EnvContext
- Modify lazy load a single instance of okhttp client
- Modify examples and java docs
- Fix ClassCastException when multiUpload
- Fix an issue that may not get the response header "Content-Length" when download.
- Add supports for lifecycle and notification
- Fix the char ':' in http headers has been encoded
- Fix a json object's types error in json string
- Modify examples and github pages doc.
- Fix nullable check of type enum in request header
-
Modify UploadManager and UploadManagerCallback
-
We make interface UploadManagerCallback become a abstract class
Not all of users need sign with server. We make methods "String onSignature(String strToSign)" and "String onAccessKey()" do not auto override. To support java 1.6 as well, default method in interface does not work.
In summary, interface UploadManagerCallback is a abstract class now.
-
A correct time method added in UploadManagerCallback.
-
A method to correct time added in UploadManager when sign.
-
-
Modify examples
Modify examples about how to correct the time of your device.
If the local time of users' clients are not synchronized with the network time, may occur a signture error.
Now you can correct the time of your device by below codes.
requestHandler.getBuilder().setHeader(QSConstant.HEADER_PARAM_KEY_DATE, gmtTime); requestHandler.send();
See examples for more info.
Sign With Server - English Version Sign With Server - Chinese Version
UploadManager - English Version UploadManager - Chinese Version
-
Fix generate signed url may miss request uri
-
Add requestHandlers in ImageProgressClient
-
Modify examples
We fixed a lot of mistakes in examples. And add an example about how to do a image progress. Visit below links to get examples.
- Fix the problem that call incorrect progress of multipart upload.
-
Add a class 'CancellationHandler' to handle cancellation when upload.
Visit below links to get examples.
-
Add upload manager to auto upload which will keep the position last uploaded.
Visit below links to get examples.
-
Fix improper design of multipart upload interface. Now we allow to upload either using offsets to a file or using slices of large content that stored separately.
Visit below links to know more.
-
Add some examples.
You can see the new examples here:
-
Fixed the encoding problem when set the http header with key "content-disposition".
(The java method corresponding to:
Bucket#GetObjectInput#setResponseContentDisposition(String);).
-
Add some examples.
You can see the examples here:
-
Fixed java docs errors in the template.
-
Fixed twice encode when set responseContentDisposition.
Now you can set responseContentDisposition like this:
Bucket.GetObjectInput inputs = new Bucket.GetObjectInput(); String fileName = "测试图片(测试).jpg"; String urlName = URLEncoder.encode(fileName, "utf-8"); //do not add blanks int the key "attachment;filename=" inputs.setResponseContentDisposition("attachment;filename=" + urlName); RequestHandler handle = bucket.GetObjectBySignatureUrlRequest("测试图片(测试).jpg", inputs, System.currentTimeMillis() + 10000); String tempUrl = handle.getExpiresRequestUrl();
-
Add config to change url style.
Available url style: One is the default, when requestUrlStyle != QSConstant#PATH_STYLE} You may see the url like this(QSConstant#VIRTUAL_HOST_STYLE): https://bucket-name.zone-id.qingstor.com/object-name Otherwise you may see the url like this(QSConstant#PATH_STYLE): https://zone-id.qingstor.com/bucket-name/object-name
- Now you can add configs in EvnContext to change url style. In java:
EvnContext evn = EvnContext.loadFromFile("config_stor.yaml"); Bucket bucket = new Bucket(evn, zoneId, bucketName);
About file config_stor.yaml you can add configs below:
# QingStor services configuration access_key_id: 'ACCESS_KEY_ID' secret_access_key: 'SECRET_ACCESS_KEY' host: 'qingstor.com' port: '443' protocol: 'https' connection_retries: 3 # uri: '/iaas' # Valid log levels are "debug", "info", "warn", "error", and "fatal". log_level: 'warn' # Valid request url styles are "virtual_host_style"(default) and "path_style" request_url_style: 'path_style'
Attention: if some of the configs you do not use, please add a "#" at the first of the line. Like this:
# port: '443'- Or set request url style with EvnContext.
EvnContext evn = new EvnContext("ACCESS_KEY_ID_EXAMPLE", "SECRET_ACCESS_KEY_EXAMPLE"); //Valid request url styles' params are QSConstant.PATH_STYLE and QSConstant.VIRTUAL_HOST_STYLE evn.setRequestUrlStyle(QSConstant.PATH_STYLE); String zoneName = "pek3a"; String bucketName = "testBucketName"; Bucket bucket = new Bucket(evn, zoneKey, bucketName);
- Remove required content-length parameter for upload inputstream.
- Add image process API.
- Add Last-Modified to getObject response head.
- Optimize type definition.
- Remove default zone.
- Remove deprecated method.
- Update dependency okhttp lib to 3.5.0.
- Assign query signature to request params .
- Modify List Multipart Uploads API.
- Add new headers to UploadMultipart.
- Add Content-Length to GetObject response headers.
- Object to jsonstring optimization.
- Adjust response message model.
- Fixed encoders are not thread-safe.
- Improve the implementation of list multipart uploads.
- Out of int type range.
- Url inputstream buffer read.
- Assii character encode.
- Object name is contain the same as the bucket name will get error suffix path.
- Android adapter.
- Add request parameters for GET Object.
- Add IP address conditions for bucket policy.
- Add more parameters to sign.
- Fix signer bug.
- Improve the implementation of deleting multiple objects.
- QingStor SDK for the JAVA programming language. [v2.2.1]: https://github.com/yunify/qingstor-sdk-java/compare/2.2.0...2.2.1 [v2.2.0]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.10...2.2.0 [v2.1.10]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.9...2.1.10 [v2.1.9]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.8...2.1.9 [v2.1.8]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.7...2.1.8 [v2.1.7]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.6...2.1.7 [v2.1.6]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.5...2.1.6 [v2.1.5]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.4...2.1.5 [v2.1.4]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.3...2.1.4 [v2.1.3]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.2...2.1.3 [v2.1.2]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.1...2.1.2 [v2.1.1]: https://github.com/yunify/qingstor-sdk-java/compare/2.1.0...2.1.1 [v2.1.0]: https://github.com/yunify/qingstor-sdk-java/compare/2.0.1...2.1.0 [v2.0.1]: https://github.com/yunify/qingstor-sdk-java/compare/2.0.0...2.0.1