GithubHelp home page GithubHelp logo

jcabi / jcabi-s3 Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 20.0 2.14 MB

Object-Oriented Layer on Top of Amazon S3 SDK

Home Page: https://s3.jcabi.com

License: Other

Java 100.00%
amazon-s3-sdk java library object-oriented

jcabi-s3's Introduction

logo

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

mvn PDD status Maven Central Hits-of-Code License

This project is just a parent POM for all other Java projects in "jcabi family".

See www.jcabi.com website for more details.

jcabi-s3's People

Contributors

adamsiemion avatar gvlasov avatar maurezen avatar pnatashap avatar prondzyn avatar renovate[bot] avatar romankisilenko avatar rultor avatar super132 avatar valery1707 avatar yamstranger avatar yegor256 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jcabi-s3's Issues

Bucket.Prefixed fails with out of bound exception

This code:

        final Region region = new MkRegion(this.temp.newFolder());
        final Bucket bucket = region.bucket("foo");
        new Ocket.Text(bucket.ocket("1/foo.txt")).write("");
        new Ocket.Text(bucket.ocket("1/2/foo.txt")).write("");
        new Ocket.Text(bucket.ocket("1/2/3/foo.txt")).write("");
        MatcherAssert.assertThat(
            new Bucket.Prefixed(bucket, "1/").list(""),
            Matchers.<String>iterableWithSize(1)
        );

Causes:

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1875)
    at com.jcabi.s3.Bucket$Prefixed$1.apply(Bucket.java:186)
    at com.jcabi.s3.Bucket$Prefixed$1.apply(Bucket.java:183)
    at com.google.common.collect.Iterators$8.transform(Iterators.java:817)
    at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
    at com.google.common.collect.Iterators$7.computeNext(Iterators.java:674)
    at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
    at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
    at org.hamcrest.collection.IsIterableWithSize.featureValueOf(IsIterableWithSize.java:21)
    at org.hamcrest.collection.IsIterableWithSize.featureValueOf(IsIterableWithSize.java:11)
    at org.hamcrest.FeatureMatcher.matchesSafely(FeatureMatcher.java:40)
    at org.hamcrest.TypeSafeDiagnosingMatcher.matches(TypeSafeDiagnosingMatcher.java:55)
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:12)
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
    at com.jcabi.s3.mock.MkBucketTest.listsOcketsWithDifferentPrefixes(MkBucketTest.java:96)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

MkBucketTest.listsOckets fails locally

Running mvn clean install locally on windows machine leads to the result:

Failed tests:
  MkBucketTest.listsOckets:68
Expected: (an iterable with size <2> and a collection containing "hello.txt" and a collection containing "f/2.txt")
     but: a collection containing "f/2.txt" was "f\2.txt", was "hello.txt"

It seems that path delimiters there are OS dependent.

Different results of local and CI qulice invocation

Running locally mvn clean install -Pqulice leads to many lines in the build log looking like

...
[ERROR] \src\test\java\com\jcabi\s3\RegionITCase.java[30]: Lines in file should end with Unix-like end of line (RegexpMultilineCheck)
[ERROR] \src\test\java\com\jcabi\s3\RegionITCase.java[36]: Lines in file should end with Unix-like end of line (RegexpMultilineCheck)
[ERROR] \src\test\java\com\jcabi\s3\RegionITCase.java[45]: Lines in file should end with Unix-like end of line (RegexpMultilineCheck)
[ERROR] \src\test\java\com\jcabi\s3\RegionITCase.java[52]: Lines in file should end with Unix-like end of line (RegexpMultilineCheck)
[ERROR] \src\test\java\com\jcabi\s3\RegionITCase.java[66]: Lines in file should end with Unix-like end of line (RegexpMultilineCheck)
[ERROR] \src\test\java\com\jcabi\s3\RegionITCase.java[68]: Lines in file should end with Unix-like end of line (RegexpMultilineCheck)
[ERROR] \src\test\resources\log4j.properties[27]: Lines in file should end with Unix-like end of line (RegexpMultilineCheck)
[ERROR] \src\test\resources\log4j.properties[30]: Lines in file should end with Unix-like end of line (RegexpMultilineCheck)
[ERROR] \src\test\resources\log4j.properties[35]: Lines in file should end with Unix-like end of line (RegexpMultilineCheck)
[ERROR] \src\test\resources\log4j.properties[38]: Lines in file should end with Unix-like end of line (RegexpMultilineCheck)
[INFO] Read our quality policy: http://www.qulice.com/quality.html
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
...

It differs from the actual result here, but should not.

mvn -version returns the following:

Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T20:29:23+03:00)
Maven home: d:\apps\apache-maven-3.2.5\bin\..
Java version: 1.7.0_72, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_72\jre
Default locale: en_US, platform encoding: Cp1251
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Bucket.exists()

Let's add method Bucket.exists() to check bucket existence

Indie tech review no.1

Review our existing source code and all other technical artifacts and report at least 8 bugs. More about such reviews you can read here. The task will be closed once we have that bugs reported and classified. Don't forget to add itr tag to each of them.

Ocket.exists()

Let's add method Ocket.exists() to check for S3 object existence.

MkOcket should return some meaningful ObjectMetadata

Right now, MkOcket.meta() just returns a new instance of ObjectMetadata. However, it would be useful for ObjectMetadata to return some meaningful (and commonly used) data.

For example, contentLength would be useful when I need to test a class which needs to get the total size of a bucket (like in libreio/libre#131). I suggest we start with adding contentLength and identify other data that might be of use for projects that test with MkOcket.

pom.xml:160-162: For some reason this profile doesn't wor...

The puzzle 47-51f62688 in pom.xml (lines 160-162) has to be resolved: For some reason this profile doesn't work any more. Most probably because of the absence of Cobertura. Let's configure it properly, so that it works with Jacocco.

The puzzle was created by Yegor Bugayenko on 25-Jan-17.

Estimate: 30 minutes, role: IMP.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code.

0.11

Please, publish a new release 0.11 (or higher). Don't forget to update us here regularly (at least once a week), as explained in this article.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/codecov.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/cache v4
  • codecov/codecov-action v4
  • ubuntu 22.04
.github/workflows/mvn.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/cache v4
.github/workflows/pdd.yml
  • actions/checkout v4
  • ubuntu 22.04
.github/workflows/xcop.yml
  • actions/checkout v4
  • ubuntu 22.04
maven
pom.xml
  • com.jcabi:jcabi 1.39.0
  • com.jcabi:jcabi-aspects 0.25.1
  • com.jcabi:jcabi-log 0.24.1
  • javax.activation:activation 1.1.1
  • org.projectlombok:lombok 1.18.34
  • org.aspectj:aspectjrt 1.9.20.1
  • com.amazonaws:aws-java-sdk-core 1.12.684
  • com.amazonaws:aws-java-sdk-s3 1.12.684
  • com.google.guava:guava 33.3.0-jre
  • commons-io:commons-io 2.15.1
  • org.apache.commons:commons-lang3 3.16.0
  • javax.validation:validation-api 2.0.1.Final
  • junit:junit 4.13.2
  • org.slf4j:slf4j-log4j12 2.0.16
  • log4j:log4j 1.2.17
  • org.hamcrest:hamcrest-core 3.0
  • org.hamcrest:hamcrest-library 3.0
  • org.junit.vintage:junit-vintage-engine 5.9.1
  • com.qulice:qulice-maven-plugin 0.22.0

  • Check this box to trigger a request for Renovate to run again on this repository

AwsBucket.java:115-119: Large lists are not supported....

Puzzle 2-68b8eec9 in src/main/java/com/jcabi/s3/AwsBucket.java:115-119 has to be resolved: Large lists are not supported. The method doesn't support marker functionality, provided by ObjectListing. We should create a test that reproduces the problem and fix the method. The method should return an iterable, which should fetch portions of objects from S3 on demand.

If you have any technical questions, don't ask me, submit new tickets instead

com.amazonaws.AbortedException

After the changes in #41 AwsOcket#write() doesn't work:

com.amazonaws.AbortedException:
    at com.amazonaws.internal.SdkFilterInputStream.abortIfNeeded(SdkFilterInputStream.java:51)
    at com.amazonaws.internal.SdkFilterInputStream.markSupported(SdkFilterInputStream.java:107)
    at com.amazonaws.http.AmazonHttpClient.beforeRequest(AmazonHttpClient.java:450)
    at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:355)
    at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:328)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:307)
    at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3649)
    at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1414)
    at com.amazonaws.services.s3.transfer.internal.UploadCallable.uploadInOneChunk(UploadCallable.java:131)
    at com.amazonaws.services.s3.transfer.internal.UploadCallable.call(UploadCallable.java:123)
    at com.amazonaws.services.s3.transfer.internal.UploadMonitor.call(UploadMonitor.java:139)
    at com.amazonaws.services.s3.transfer.internal.UploadMonitor.call(UploadMonitor.java:47)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Bucket#list()

Let's add new method list() to Bucket interface, which should list ockets using a prefix.

S3-compatible API's not supported

S3 is actually supported by non-amazon service providers including dreamobjects, ceph (with addons), and riak.

It would be really nice to be able to connect to non-amazon URL's

AWS S3 connection using another provider (mDNS avahi entry used)

AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
AmazonS3 conn = new AmazonS3Client(credentials);
conn.setEndpoint("s3-compatible-url.local");

0.10

Please, publish a new release 0.10 (or higher). Don't forget to update us here regularly (at least once a week), as explained in this article.

Qulice configuration - no license specified.

  1. Checkout master branch
  2. run mvn qulice:check -Pqulice
  3. There are multiple Line does not match expected header line of ' * BSD License'. (HeaderCheck) messages.

This is a known bug of qulice configuration in parent-0.31 (jcabi/jcabi-parent#19), accessed via jcabi-0.16. Suggested action is waiting until jcabi/jcabi#297 fix is released and upgrading jcabi version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.