This topic is written based on Object Storage Service (OSS) SDK for Java V3.15.0.

Versions

Before you download OSS SDK for Java, select a version based on your needs. OSS manages download links for the source code of OSS SDK for Java by using a Maven repository and provides the source code on GitHub for your reference.

Source Description
Maven repository The path where you can download the source code of OSS SDK for Java. You can obtain the version of dependencies to be injected into OSS SDK for Java for your Maven project from the Maven repository.
Note We recommend that you obtain the latest version of OSS SDK for Java for debugging to prevent errors.
For more information, see Alibaba Cloud OSS SDK for Java.
GitHub GitHub provides the source code of OSS SDKs and records tag information about the releases of the SDKs. You can view the source code and sample code in a variety of scenarios on GitHub. For more information, see Alibaba Cloud OSS SDK Releases for Java.

Compatibility

Version compatibility of OSS SDK for Java:

  • OSS SDK for Java V3.x.x:
    • API operations: compatible
    • Namespace: compatible
  • OSS SDK for Java V2.x.x:
    • API operations: compatible
    • Namespace: compatible
  • OSS SDK for Java V1.0.x:
    • API operations: compatible
    • Namespace: incompatible. The code for Tablestore in OSS SDK for Java V1.0.x is removed from OSS SDK for Java V2.0.0 and the package names com.aliyun.openservices.* and com.aliyun.openservices.oss.* are changed to com.aliyun.oss.*.

Source code and API documentation

For more information about the source code of OSS SDK for Java, visit GitHub. For more information about the API documentation, see Aliyun OSS SDK for Java 3.13.2 API.

Sample code

OSS SDK for Java provides a variety of sample code files for your reference or use. The following table lists the sample code files provided by OSS SDK for Java.

Sample code file Content
GetStartedSample.java Quick start
BucketOperationsSample.java
BucketTaggingSample.java Bucket tagging
BucketInventorySample.java Bucket inventory
BucketPolicySample.java Bucket policy
BucketWormSample.java Retention policies
SetRequestPaymentSample.java Enable pay-by-requester
BucketReplicationSample.java Cross-region replication
BucketTransferAccelerationSample.java Transfer acceleration
CreateFolderSample.java Simple upload
PostObjectSample.java Form upload
Note Use PostObject for form upload. The implementation of form upload is independent of OSS SDK for Java.
AppendObjectSample.java Append upload
UploadSample.java Resumable upload
MultipartUploadSample.java Multipart upload
CallbackSample.java Upload callback
SimpleGetObjectSample.java Download objects
DownloadSample.java Resumable download
ConcurrentGetObjectSample.java Resumable download
GetProgressSample.java
GetStartedSample.java
ObjectMetaSample.java Manage object metadata
StorageTypeSample.java Convert the storage classes of objects
ListObjectsSample.java List objects
SelectObjectSample.java Query objects
ObjectOperationSample.java Rename objects
DeleteObjectsSample.java Delete objects
UploadPartCopySample.java Copy objects
ObjectOperationSample.java Prevent objects from being overwritten by objects that have the same names
RestoreObjectSample.java Restore objects
SymLinkSample.java Manage symbolic links
DirectoryManageSample.java Manage directories
BucketVersioningSample.java Versioning
ObjectTaggingSample.java
TrafficLimitSample.java Single-connection bandwidth throttling
EncryptionClientRsaSample.java Client-side encryption
EncryptionServiceSample.java Server-side encryption
AuthorizedAccessSample.java Authorized access
CRCSample.java CRC-64
ImageSample.java Overview