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

Fixed bug where getFileClient and getSubDirectoryClient on DirectoryClient would throw IllegalArgumentException if either resource had special characters. #18542

Merged

Conversation

gapra-msft
Copy link
Member

Resolves #18469

@ghost ghost added the Storage Storage Service (Queues, Blobs, Files) label Jan 11, 2021
@@ -173,8 +173,8 @@ public DataLakeFileAsyncClient getFileAsyncClient(String fileName) {

return new DataLakeFileAsyncClient(getHttpPipeline(),
StorageImplUtils.appendToUrlPath(getPathUrl(), Utility.urlEncode(Utility.urlDecode(fileName))).toString(),
getServiceVersion(), getAccountName(), getFileSystemName(), getObjectPath() + "/"
+ Utility.urlDecode(fileName), blockBlobAsyncClient);
getServiceVersion(), getAccountName(), getFileSystemName(), Utility.urlEncode(getObjectPath() + "/"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constructor expects an encoded path

resourcePrefix | subResourcePrefix || _
"" | "" || _
Utility.urlEncode("%") | "" || _ // Resource has special character
"" | Utility.urlEncode("%") || _ // Sub resource has special character
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should check the path against the expected string to ensure the right amount of encoding/decoding is happening

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add that

@gapra-msft gapra-msft merged commit e4c0634 into Azure:master Jan 13, 2021
@gapra-msft gapra-msft deleted the storage/datalakeGetFileWithPercent branch January 13, 2021 20:14
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-java that referenced this pull request Apr 20, 2022
SCVMM public preview API spec (Azure#18542)

* add openapi spec for scvmm

* lint fixes, spell fixes

* typo fix

* prettier

* force delete query param

* removing some deprecated properties

* remove additional props
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] ADLS Gen2: SDK is unable to read files containing % and # in the file name
2 participants