From ed2d1b8139acd7944c27006acc6959ff802322bf Mon Sep 17 00:00:00 2001 From: Lorenzo Conti Date: Fri, 2 Mar 2018 15:29:46 -0800 Subject: [PATCH 1/2] Add a note to allow the use of ~/.aws/credentials We can also use the ~/.aws/credentials to set the credentials for the bucket. --- settings.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/settings.yml b/settings.yml index 5d6533c..59ed31d 100644 --- a/settings.yml +++ b/settings.yml @@ -2,6 +2,7 @@ enableCors: true corsOrigins: "*" # If using attaching IAM Role to instance leave accessKey and secretKey empty +# You can also leave accessKey and secretKey empty if you prefer to use credentials from ~/.aws/credentials s3Fs: bucket: pathPrefix: From bfef13c74e0d03dc4bd782988789854c85a10e5c Mon Sep 17 00:00:00 2001 From: Lorenzo Conti Date: Tue, 19 Jun 2018 13:03:19 -0700 Subject: [PATCH 2/2] S3filesystem shoud returm a valid S3 record --- .../java/com/takipi/oss/storage/fs/s3/S3Filesystem.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/takipi/oss/storage/fs/s3/S3Filesystem.java b/src/main/java/com/takipi/oss/storage/fs/s3/S3Filesystem.java index 86e77ec..1fb4b86 100644 --- a/src/main/java/com/takipi/oss/storage/fs/s3/S3Filesystem.java +++ b/src/main/java/com/takipi/oss/storage/fs/s3/S3Filesystem.java @@ -12,7 +12,7 @@ import com.amazonaws.services.s3.model.S3ObjectSummary; import com.takipi.oss.storage.data.simple.SimpleSearchResponse; import com.takipi.oss.storage.fs.BaseRecord; -import com.takipi.oss.storage.fs.SimplePathRecord; +import com.takipi.oss.storage.fs.Record; import com.takipi.oss.storage.fs.api.Filesystem; import com.takipi.oss.storage.fs.api.SearchRequest; import com.takipi.oss.storage.fs.api.SearchResult; @@ -96,7 +96,11 @@ public boolean healthy() { @Override public BaseRecord pathToRecord(String path) { - return SimplePathRecord.newRecord(path); + String[] strs = path.trim().split(File.separator,3); + if (strs.length == 3) + return Record.newRecord(strs[0], strs[1], strs[2]); + else + return null; } private String keyOf(T record) {