0

I am using Java 8 and aws-java-sdk-s3 version 1.11.251. When I use a reserved characters in filename. The SQS returns the inputKey as encoded format like the following,

Original File name: video-test4!!.mp4
Received File name from SQS: video-test4%21%21.mp4

When I use Square Brackets "[", "]", it replace with "_". Why its returns like the following,

Original File name: test[].mp4
Received File name from SQS: test__.mp4"

How to decode the "test__.mp4" to test[].mp4?

Kindly provide your inputs.

SST
  • 2,054
  • 5
  • 35
  • 65

1 Answers1

0

Since [ and ] are both converted into _, there's no recovering what the original characters had been -- information has been lost.

That said, you really shouldn't be using either [ or ] as characters in a file name. It appears this particular SDK is forcing you to use only file names built out of characters that are universally acceptable as valid file name characters in all major OSes.

kshetline
  • 12,547
  • 4
  • 37
  • 73