Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

ECS 3.6.2 Data Access Guide

PDF

ECS Java SDK

The ECS Java SDK is built on the Jersey REST client, and it supports the ECS API extensions.

An example of using this SDK (S3Client) is shown below.

package com.emc.ecs.s3.sample;

import com.emc.object.s3.*;
import com.emc.object.s3.jersey.S3JerseyClient;

import java.net.URI;

public class S3ClientSample {
    public static void main(String[] args) throws Exception {
        URI endpoint = new URI("http://ecs.yourco.com:9020");
        String accessKey = "fred@yourco.com";
        String secretKey = "pcQQ20rDI2DHZOIWNkAug3wK4XJP9sQnZqbQJev3";

        S3Config config = new S3Config(endpoint);
        config.withIdentity(accessKey).withSecretKey(secretKey);

        S3Client s3Client = new S3JerseyClient(config);
        S3ClientSample sample = new S3ClientSample(s3Client);

        sample.runSample();
    }

    private final S3Client s3Client;

    public S3ClientSample(S3Client s3Client) {
        this.s3Client = s3Client;
    }

    public void runSample() {
        String bucketName = "mybucket";
        String key1 = "test1.txt";
        String content = "Hello World!";

        try {
            s3Client.createBucket(bucketName);
            s3Client.putObject(bucketName, key1, content, "text/plain");
        } catch (S3Exception e) {
            // handle errors
        }
    }
}

Rate this content

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please select whether the article was helpful or not.
  Comments cannot contain these special characters: <>()\