From: John Wilkins Date: Fri, 31 May 2013 18:15:20 +0000 (-0700) Subject: doc: Added Java example for setting protocol to HTTP. X-Git-Tag: v0.65~172 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=54d230529b28aedf3697ff87a77369322dbaa1d6;p=ceph.git doc: Added Java example for setting protocol to HTTP. Signed-off-by: John Wilkins --- diff --git a/doc/radosgw/s3/java.rst b/doc/radosgw/s3/java.rst index 0bcd8724a5df..468bf2f1740d 100644 --- a/doc/radosgw/s3/java.rst +++ b/doc/radosgw/s3/java.rst @@ -28,6 +28,31 @@ classes to be imported: import com.amazonaws.services.s3.model.S3ObjectSummary; +If you are just testing the Ceph Object Storage services, consider +using HTTP protocol instead of HTTPS protocol. + +First, import the ``ClientConfiguration`` and ``Protocol`` classes. + +.. code-block:: java + + import com.amazonaws.ClientConfiguration; + import com.amazonaws.Protocol; + + +Then, define the client configuration, and add the client configuration +as an argument for the S3 client. + +.. code-block:: java + + AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey); + + ClientConfiguration clientConfig = new ClientConfiguration(); + clientConfig.setProtocol(Protocol.HTTP); + + AmazonS3 conn = new AmazonS3Client(credentials, clientConfig); + conn.setEndpoint("endpoint.com"); + + Creating a Connection ---------------------