Skip to content
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

ListObjectsUnmarshaller.unmarshall method is removing the special character from the file name #3154

Closed
1 task
vikranthpatoju opened this issue Oct 10, 2024 · 1 comment
Assignees
Labels
bug This issue is a bug. closed-for-staleness

Comments

@vikranthpatoju
Copy link

Describe the bug

I am trying to send the API request to S3 to get the list of files from a bucket.
Sample Endpoint - https://evidences-civil1.s3.amazonaws.com/. There are few files in the bucket having filenames with special characters (eg: [email protected]).
As part of my solution, i am using the S3 SDK to retrieve the data and display them locally but when using this method as below, it does remove the special character from the file like this - Screenshot [email protected].
ListObjectsUnmarshaller unmarshaller = new Unmarshallers.ListObjectsUnmarshaller(true);
return unmarshaller.unmarshall(inputStream);

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Ideally ListObjectsUnmarshaller.unmarshall should return the same output without sanitizing it.

Current Behavior

There are no relavant errors as such

Reproduction Steps

ListObjectsUnmarshaller unmarshaller = new Unmarshallers.ListObjectsUnmarshaller(true);
return unmarshaller.unmarshall(inputStream);

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

sdk 1.12.520

JDK version used

OpenJDK Runtime Environment Zulu21.30+16-SA

Operating System and version

x86_64 GNU/Linux

@vikranthpatoju vikranthpatoju added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 10, 2024
@debora-ito
Copy link
Member

@vikranthpatoju even though ListObjectsUnmarshaller is public, we don't recommend using any marshaller in isolation outside the client. That's because some of the logic may be written in other stages of the request lifecycle.

In this case, when you call the ListObjectsV2 API, the output is expected:

        ListObjectsV2Result result  = s3Client.listObjectsV2(BUCKET);
        result.getObjectSummaries().stream().forEach(c -> System.out.println(c.getKey()));

        // output:
        // [email protected]

Transferring this issue to the Java SDK v1 repository.

@debora-ito debora-ito transferred this issue from aws/aws-sdk-java-v2 Oct 10, 2024
@debora-ito debora-ito added closing-soon This issue will close in 2 days unless further comments are made. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 10, 2024
@debora-ito debora-ito self-assigned this Oct 10, 2024
@github-actions github-actions bot added closed-for-staleness and removed closing-soon This issue will close in 2 days unless further comments are made. labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness
Projects
None yet
Development

No branches or pull requests

2 participants