Skip to content

Simple AmazonS3URI methods missing on V2 #1107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brainstorm opened this issue Mar 1, 2019 · 1 comment
Closed

Simple AmazonS3URI methods missing on V2 #1107

brainstorm opened this issue Mar 1, 2019 · 1 comment

Comments

@brainstorm
Copy link

brainstorm commented Mar 1, 2019

EDIT: Duplicate of #272.

Expected Behavior

I would have expected to have a simple S3URI method like the one present in aws sdk java v1:

https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3URI.html#AmazonS3URI-java.lang.String-

To do things like:

public static Tuple<String, String> bucketAndKey(String S3urlString) {
        AmazonS3URI s3URI = new AmazonS3URI(S3urlString);
        String bucket = s3URI.getBucket();
        String key = s3URI.getKey();

        log.debug("bucketAndKey(): "+ bucket + " , " + key);
        return new Tuple(bucket, key);
    }

The closest I can get to that is S3Location, but it doesn't take plain strings (i.e s3://example-bucket/example-prefix) as building parameters, unfortunately.

Current Behavior

Currently I'm forced to do inefficient/ugly plain string matching on s3://example-bucket/example-prefix to get to the different components. I would like more convenient builders and accessors for this.

Possible Solution

Perhaps just porting v1 S3URI method/code to v2's S3Location would be enough?

@brainstorm
Copy link
Author

Duplicate, sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant