You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2015/05/01 16:44:33 UTC
[01/10] incubator-usergrid git commit: Added AwsSdkS3BinaryStore class
Repository: incubator-usergrid
Updated Branches:
refs/heads/master 8d749ca6e -> c448a1f23
Added AwsSdkS3BinaryStore class
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/133887fa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/133887fa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/133887fa
Branch: refs/heads/master
Commit: 133887fa17e5f32b1802cfa54cf92e72aa5b333e
Parents: e7a543b
Author: rgex <12...@supinfo.com>
Authored: Sun Apr 26 15:44:28 2015 -0400
Committer: rgex <12...@supinfo.com>
Committed: Sun Apr 26 15:44:28 2015 -0400
----------------------------------------------------------------------
.../assets/data/AwsSdkS3BinaryStore.java | 230 +++++++++++++++++++
1 file changed, 230 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/133887fa/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AwsSdkS3BinaryStore.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AwsSdkS3BinaryStore.java b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AwsSdkS3BinaryStore.java
new file mode 100644
index 0000000..4163d70
--- /dev/null
+++ b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AwsSdkS3BinaryStore.java
@@ -0,0 +1,230 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.usergrid.services.assets.data;
+
+
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Map;
+import java.util.UUID;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.apache.usergrid.persistence.Entity;
+import org.apache.usergrid.persistence.EntityManagerFactory;
+
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+
+import com.amazonaws.ClientConfiguration;
+import com.amazonaws.Protocol;
+import com.amazonaws.auth.AWSCredentials;
+import com.amazonaws.auth.BasicAWSCredentials;
+import com.amazonaws.regions.Region;
+import com.amazonaws.regions.Regions;
+import com.amazonaws.services.s3.AmazonS3;
+import com.amazonaws.services.s3.AmazonS3Client;
+import com.amazonaws.services.s3.model.CompleteMultipartUploadRequest;
+import com.amazonaws.services.s3.model.CompleteMultipartUploadResult;
+import com.amazonaws.services.s3.model.DeleteObjectRequest;
+import com.amazonaws.services.s3.model.InitiateMultipartUploadRequest;
+import com.amazonaws.services.s3.model.InitiateMultipartUploadResult;
+import com.amazonaws.services.s3.model.ObjectMetadata;
+import com.amazonaws.services.s3.model.PartETag;
+import com.amazonaws.services.s3.model.PutObjectResult;
+import com.amazonaws.services.s3.model.S3Object;
+import com.amazonaws.services.s3.model.UploadPartRequest;
+import com.google.common.primitives.Ints;
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
+import java.io.PushbackInputStream;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.codec.binary.Base64;
+
+
+public class AwsSdkS3BinaryStore implements BinaryStore {
+
+ private static final Logger LOG = LoggerFactory.getLogger(AwsSdkS3BinaryStore.class );
+ private static final long FIVE_MB = ( FileUtils.ONE_MB * 5 );
+
+ private AmazonS3 s3Client;
+ private String accessId;
+ private String secretKey;
+ private String bucketName;
+ private String regionName;
+
+ @Autowired
+ private EntityManagerFactory emf;
+
+
+ public AwsSdkS3BinaryStore( String accessId, String secretKey, String bucketName, String regionName ) {
+ this.accessId = accessId;
+ this.secretKey = secretKey;
+ this.bucketName = bucketName;
+ this.regionName = regionName;
+ }
+
+ public AwsSdkS3BinaryStore( String accessId, String secretKey, String bucketName ) {
+ this.accessId = accessId;
+ this.secretKey = secretKey;
+ this.bucketName = bucketName;
+ }
+
+ private AmazonS3 getS3Client() {
+ if ( s3Client == null ) {
+ AWSCredentials credentials = new BasicAWSCredentials(accessId, secretKey);
+ ClientConfiguration clientConfig = new ClientConfiguration();
+ clientConfig.setProtocol(Protocol.HTTP);
+
+ s3Client = new AmazonS3Client(credentials, clientConfig);
+ if(regionName != null)
+ s3Client.setRegion( Region.getRegion(Regions.fromName(regionName)) );
+ }
+
+ return s3Client;
+ }
+
+
+ @Override
+ public void write( final UUID appId, final Entity entity, InputStream inputStream ) throws IOException {
+
+ String uploadFileName = AssetUtils.buildAssetKey( appId, entity );
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ long written = IOUtils.copyLarge( inputStream, baos, 0, FIVE_MB );
+
+ byte[] data = baos.toByteArray();
+
+ InputStream awsInputStream = new ByteArrayInputStream(data);
+
+ final Map<String, Object> fileMetadata = AssetUtils.getFileMetadata( entity );
+ fileMetadata.put( AssetUtils.LAST_MODIFIED, System.currentTimeMillis() );
+
+ String mimeType = AssetMimeHandler.get().getMimeType( entity, data );
+
+ if ( written < FIVE_MB ) { // total smaller than 5mb
+
+ ObjectMetadata om = new ObjectMetadata();
+ om.setContentLength(written);
+ om.setContentType(mimeType);
+ PutObjectResult result = getS3Client().putObject(bucketName, uploadFileName, awsInputStream, om);
+
+ String md5sum = Hex.encodeHexString( Base64.decodeBase64(result.getContentMd5()) );
+ String eTag = result.getETag();
+
+ fileMetadata.put( AssetUtils.CONTENT_LENGTH, written );
+
+ if(md5sum != null)
+ fileMetadata.put( AssetUtils.CHECKSUM, md5sum );
+ fileMetadata.put( AssetUtils.E_TAG, eTag );
+ }
+ else { // bigger than 5mb... dump 5 mb tmp files and upload from them
+ written = 0; //reset written to 0, we still haven't wrote anything in fact
+ int partNumber = 1;
+ int firstByte = 0;
+ Boolean isFirstChunck = true;
+ List<PartETag> partETags = new ArrayList<PartETag>();
+
+ InitiateMultipartUploadRequest initRequest = new InitiateMultipartUploadRequest(bucketName, uploadFileName);
+ InitiateMultipartUploadResult initResponse = getS3Client().initiateMultipartUpload(initRequest);
+
+ InputStream firstChunck = new ByteArrayInputStream(data);
+ PushbackInputStream chunckableInputStream = new PushbackInputStream(inputStream, 1);
+
+ while (-1 != (firstByte = chunckableInputStream.read())) {
+ long partSize = 0;
+ chunckableInputStream.unread(firstByte);
+ File tempFile = File.createTempFile( entity.getUuid().toString().concat("-part").concat(String.valueOf(partNumber)), "tmp" );
+
+ tempFile.deleteOnExit();
+ OutputStream os = null;
+ try {
+ os = new BufferedOutputStream( new FileOutputStream( tempFile.getAbsolutePath() ) );
+
+ if(isFirstChunck == true) {
+ partSize = IOUtils.copyLarge( firstChunck, os, 0, ( FIVE_MB ) );
+ isFirstChunck = false;
+ }
+ else {
+ partSize = IOUtils.copyLarge( chunckableInputStream, os, 0, ( FIVE_MB ) );
+ }
+ written += partSize;
+ }
+ finally {
+ IOUtils.closeQuietly( os );
+ }
+
+ FileInputStream chunck = new FileInputStream(tempFile);
+
+ Boolean isLastPart = -1 == (firstByte = chunckableInputStream.read());
+ if(!isLastPart)
+ chunckableInputStream.unread(firstByte);
+
+ UploadPartRequest uploadRequest = new UploadPartRequest().withUploadId(initResponse.getUploadId())
+ .withBucketName(bucketName)
+ .withKey(uploadFileName)
+ .withInputStream(chunck)
+ .withPartNumber(partNumber)
+ .withPartSize(partSize)
+ .withLastPart(isLastPart);
+ partETags.add( getS3Client().uploadPart(uploadRequest).getPartETag() );
+ partNumber++;
+ }
+
+ CompleteMultipartUploadRequest request = new CompleteMultipartUploadRequest(bucketName, uploadFileName, initResponse.getUploadId(), partETags);
+ CompleteMultipartUploadResult amazonResult = getS3Client().completeMultipartUpload(request);
+ fileMetadata.put( AssetUtils.CONTENT_LENGTH, written );
+ fileMetadata.put( AssetUtils.E_TAG, amazonResult.getETag() );
+ }
+ }
+
+
+ @Override
+ public InputStream read( UUID appId, Entity entity, long offset, long length ) throws IOException {
+
+ S3Object object = getS3Client().getObject(bucketName, AssetUtils.buildAssetKey( appId, entity ));
+ byte data[] = null;
+
+ if ( offset == 0 && length == FIVE_MB ) {
+ return object.getObjectContent();
+ }
+ else {
+ object.getObjectContent().read(data, Ints.checkedCast(offset), Ints.checkedCast(length));
+ }
+
+ return new ByteArrayInputStream(data);
+ }
+
+
+ @Override
+ public InputStream read( UUID appId, Entity entity ) throws IOException {
+ return read( appId, entity, 0, FIVE_MB );
+ }
+
+
+ @Override
+ public void delete( UUID appId, Entity entity ) {
+ getS3Client().deleteObject(new DeleteObjectRequest(bucketName, AssetUtils.buildAssetKey( appId, entity )));
+ }
+}
[02/10] incubator-usergrid git commit: added aws-java-sdk-s3
dependency
Posted by sn...@apache.org.
added aws-java-sdk-s3 dependency
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/bb0b27d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/bb0b27d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/bb0b27d8
Branch: refs/heads/master
Commit: bb0b27d8a104c910c581580fb26a244435a9e223
Parents: 133887f
Author: rgex <12...@supinfo.com>
Authored: Sun Apr 26 15:48:30 2015 -0400
Committer: rgex <12...@supinfo.com>
Committed: Sun Apr 26 15:48:30 2015 -0400
----------------------------------------------------------------------
stack/services/pom.xml | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/bb0b27d8/stack/services/pom.xml
----------------------------------------------------------------------
diff --git a/stack/services/pom.xml b/stack/services/pom.xml
index 6b1bcdc..b3297d9 100644
--- a/stack/services/pom.xml
+++ b/stack/services/pom.xml
@@ -399,6 +399,11 @@
</dependency>
<dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk-s3</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-blobstore</artifactId>
</dependency>
[04/10] incubator-usergrid git commit: Update
file-storage-configuration.md
Posted by sn...@apache.org.
Update file-storage-configuration.md
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/7cd2e633
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/7cd2e633
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/7cd2e633
Branch: refs/heads/master
Commit: 7cd2e633409fae5e2b483cbd9c59feabc9561ba3
Parents: 329a9e0
Author: Jan Moritz Lindemann <12...@supinfo.com>
Authored: Sun Apr 26 16:00:14 2015 -0400
Committer: Jan Moritz Lindemann <12...@supinfo.com>
Committed: Sun Apr 26 16:00:14 2015 -0400
----------------------------------------------------------------------
docs/file-storage-configuration.md | 52 +++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7cd2e633/docs/file-storage-configuration.md
----------------------------------------------------------------------
diff --git a/docs/file-storage-configuration.md b/docs/file-storage-configuration.md
index e69de29..33ea359 100644
--- a/docs/file-storage-configuration.md
+++ b/docs/file-storage-configuration.md
@@ -0,0 +1,52 @@
+# File storage configuration
+
+Usergrid can store your assets either on your hard drive or in the Amazon S3 cloud.
+
+Local storage configuration
+---
+
+By default assets are stored in the temporary folder /tmp/usergrid
+to change this
+
+
+This is an alternative to the S3BinaryStore class in Usergrid.
+It has several advantages :
+ - upload files up to 50GB
+ - support of V4 signing process
+ - lower network latency when a regionName is defined
+
+To use it add following dependency in stack/pom.xml
+
+```xml
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk-s3</artifactId>
+ <version>1.9.31</version>
+ </dependency>
+```
+and stack/services/pom.xml
+```xml
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk-s3</artifactId>
+ </dependency>
+```
+then add the AwsSdkS3BinaryStore.java file in the /stack/services/src/main/java/org/apache/usergrid/services/assets/data/ folder.
+
+finaly define the new classpath in the /stack/rest/src/main/resources/usergrid-rest-context.xml file
+```xml
+ <bean id="binaryStore" class="org.apache.usergrid.services.assets.data.AwsSdkS3BinaryStore">
+ <constructor-arg name="accessId" value="x" />
+ <constructor-arg name="secretKey" value="xx" />
+ <constructor-arg name="bucketName" value="x" />
+ <constructor-arg name="regionName" value="eu-central-1" />
+ </bean>
+```
+the regionName field is not mandatory, this code is also valid
+```xml
+ <bean id="binaryStore" class="org.apache.usergrid.services.assets.data.AwsSdkS3BinaryStore">
+ <constructor-arg name="accessId" value="x" />
+ <constructor-arg name="secretKey" value="xx" />
+ <constructor-arg name="bucketName" value="x" />
+ </bean>
+```
[03/10] incubator-usergrid git commit: added aws config documentation
file
Posted by sn...@apache.org.
added aws config documentation file
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/329a9e0e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/329a9e0e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/329a9e0e
Branch: refs/heads/master
Commit: 329a9e0e4bfbb42ba6c80d8d508e270673396243
Parents: bb0b27d
Author: rgex <12...@supinfo.com>
Authored: Sun Apr 26 15:52:06 2015 -0400
Committer: rgex <12...@supinfo.com>
Committed: Sun Apr 26 15:52:06 2015 -0400
----------------------------------------------------------------------
docs/file-storage-configuration.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/329a9e0e/docs/file-storage-configuration.md
----------------------------------------------------------------------
diff --git a/docs/file-storage-configuration.md b/docs/file-storage-configuration.md
new file mode 100644
index 0000000..e69de29
[08/10] incubator-usergrid git commit: upgrade httpclient to v 4.4.1
Posted by sn...@apache.org.
upgrade httpclient to v 4.4.1
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/71e67da9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/71e67da9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/71e67da9
Branch: refs/heads/master
Commit: 71e67da919ed663f67154d1a847e0da5fb34aa5e
Parents: c3585c0
Author: Jan Moritz Lindemann <12...@supinfo.com>
Authored: Sun Apr 26 17:02:52 2015 -0400
Committer: Jan Moritz Lindemann <12...@supinfo.com>
Committed: Sun Apr 26 17:02:52 2015 -0400
----------------------------------------------------------------------
stack/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/71e67da9/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index dddc240..4f50779 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -233,7 +233,7 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
- <version>4.1.3</version>
+ <version>4.4.1</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
[09/10] incubator-usergrid git commit: This closes #240
Posted by sn...@apache.org.
This closes #240
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/44f07810
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/44f07810
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/44f07810
Branch: refs/heads/master
Commit: 44f07810ab54bbead7152c22dd7b95951f909a53
Parents: 2775149 71e67da
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri May 1 10:41:25 2015 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri May 1 10:41:25 2015 -0400
----------------------------------------------------------------------
docs/file-storage-configuration.md | 39 ++++
stack/pom.xml | 9 +-
stack/services/pom.xml | 5 +
.../assets/data/AwsSdkS3BinaryStore.java | 230 +++++++++++++++++++
4 files changed, 282 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[07/10] incubator-usergrid git commit: fix typo
Posted by sn...@apache.org.
fix typo
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c3585c01
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c3585c01
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c3585c01
Branch: refs/heads/master
Commit: c3585c01c77ecde6d1553a2d5b52d25de0c27cda
Parents: 9696ca5
Author: Jan Moritz Lindemann <12...@supinfo.com>
Authored: Sun Apr 26 16:36:15 2015 -0400
Committer: Jan Moritz Lindemann <12...@supinfo.com>
Committed: Sun Apr 26 16:36:15 2015 -0400
----------------------------------------------------------------------
stack/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c3585c01/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index 989c1f5..dddc240 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -156,7 +156,7 @@
</developer>
</developers>
- <modules>ht
+ <modules>
<module>java-sdk-old</module>
<module>config</module>
<module>core</module>
[10/10] incubator-usergrid git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-usergrid
Posted by sn...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c448a1f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c448a1f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c448a1f2
Branch: refs/heads/master
Commit: c448a1f23997d6f77f5c37b0c7e87593196f28b4
Parents: 44f0781 8d749ca
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri May 1 10:43:45 2015 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri May 1 10:43:45 2015 -0400
----------------------------------------------------------------------
.../apache/usergrid/rest/management/ManagementResource.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[05/10] incubator-usergrid git commit: Update
file-storage-configuration.md
Posted by sn...@apache.org.
Update file-storage-configuration.md
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/ae5bc3f6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/ae5bc3f6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/ae5bc3f6
Branch: refs/heads/master
Commit: ae5bc3f6057ee344ee0bf17188ed8a2ba14c15c2
Parents: 7cd2e63
Author: Jan Moritz Lindemann <12...@supinfo.com>
Authored: Sun Apr 26 16:09:40 2015 -0400
Committer: Jan Moritz Lindemann <12...@supinfo.com>
Committed: Sun Apr 26 16:09:40 2015 -0400
----------------------------------------------------------------------
docs/file-storage-configuration.md | 59 +++++++++++++--------------------
1 file changed, 23 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ae5bc3f6/docs/file-storage-configuration.md
----------------------------------------------------------------------
diff --git a/docs/file-storage-configuration.md b/docs/file-storage-configuration.md
index 33ea359..c56265a 100644
--- a/docs/file-storage-configuration.md
+++ b/docs/file-storage-configuration.md
@@ -6,47 +6,34 @@ Local storage configuration
---
By default assets are stored in the temporary folder /tmp/usergrid
-to change this
-
-
-This is an alternative to the S3BinaryStore class in Usergrid.
-It has several advantages :
- - upload files up to 50GB
- - support of V4 signing process
- - lower network latency when a regionName is defined
-
-To use it add following dependency in stack/pom.xml
-
-```xml
- <dependency>
- <groupId>com.amazonaws</groupId>
- <artifactId>aws-java-sdk-s3</artifactId>
- <version>1.9.31</version>
- </dependency>
-```
-and stack/services/pom.xml
+This can be changed by editing this file /stack/rest/src/main/resources/usergrid-rest-context.xml and replacing {usergrid.temp.files} by the wanted destination
```xml
- <dependency>
- <groupId>com.amazonaws</groupId>
- <artifactId>aws-java-sdk-s3</artifactId>
- </dependency>
+<bean id="binaryStore" class="org.apache.usergrid.services.assets.data.LocalFileBinaryStore">
+ <property name="reposLocation" value="${usergrid.temp.files}"/>
+</bean>
```
-then add the AwsSdkS3BinaryStore.java file in the /stack/services/src/main/java/org/apache/usergrid/services/assets/data/ folder.
-finaly define the new classpath in the /stack/rest/src/main/resources/usergrid-rest-context.xml file
+AwS S3 configuration
+---
+
+To use your AWS S3 storage you need to change the binaryStore classpath and add several constructor arguments in /stack/rest/src/main/resources/usergrid-rest-context.xml
+
+Some examples :
```xml
- <bean id="binaryStore" class="org.apache.usergrid.services.assets.data.AwsSdkS3BinaryStore">
- <constructor-arg name="accessId" value="x" />
- <constructor-arg name="secretKey" value="xx" />
- <constructor-arg name="bucketName" value="x" />
- <constructor-arg name="regionName" value="eu-central-1" />
- </bean>
+<bean id="binaryStore" class="org.apache.usergrid.services.assets.data.AwsSdkS3BinaryStore">
+ <constructor-arg name="accessId" value="x" />
+ <constructor-arg name="secretKey" value="xx" />
+ <constructor-arg name="bucketName" value="x" />
+ <constructor-arg name="regionName" value="eu-central-1" />
+</bean>
```
the regionName field is not mandatory, this code is also valid
```xml
- <bean id="binaryStore" class="org.apache.usergrid.services.assets.data.AwsSdkS3BinaryStore">
- <constructor-arg name="accessId" value="x" />
- <constructor-arg name="secretKey" value="xx" />
- <constructor-arg name="bucketName" value="x" />
- </bean>
+<bean id="binaryStore" class="org.apache.usergrid.services.assets.data.AwsSdkS3BinaryStore">
+ <constructor-arg name="accessId" value="x" />
+ <constructor-arg name="secretKey" value="xx" />
+ <constructor-arg name="bucketName" value="x" />
+</bean>
```
+
+The filesize is limited to 50GB but you need to keep in mind that the file has to be stored on the hard drive before being sended to Amazon.
[06/10] incubator-usergrid git commit: added aws-java-sdk-s3
dependency
Posted by sn...@apache.org.
added aws-java-sdk-s3 dependency
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/9696ca5d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/9696ca5d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/9696ca5d
Branch: refs/heads/master
Commit: 9696ca5d864d035be8d0bd7aed2dadd4b8dc846e
Parents: ae5bc3f
Author: Jan Moritz Lindemann <12...@supinfo.com>
Authored: Sun Apr 26 16:31:45 2015 -0400
Committer: Jan Moritz Lindemann <12...@supinfo.com>
Committed: Sun Apr 26 16:31:45 2015 -0400
----------------------------------------------------------------------
stack/pom.xml | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/9696ca5d/stack/pom.xml
----------------------------------------------------------------------
diff --git a/stack/pom.xml b/stack/pom.xml
index 82d0ea3..989c1f5 100644
--- a/stack/pom.xml
+++ b/stack/pom.xml
@@ -156,7 +156,7 @@
</developer>
</developers>
- <modules>
+ <modules>ht
<module>java-sdk-old</module>
<module>config</module>
<module>core</module>
@@ -241,6 +241,13 @@
</exclusion>
</exclusions>
</dependency>
+
+ <dependency>
+ <groupId>com.amazonaws</groupId>
+ <artifactId>aws-java-sdk-s3</artifactId>
+ <version>1.9.31</version>
+ </dependency>
+
<dependency>
<groupId>org.apache.activemq</groupId>