Azure / Azure/azure-sdk-for-java
checkAccess operation in AzureFileSystemProvider should allow AccessMode.READ
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 2.2k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 178
Description
At the moment(azure-storage-blob-nio version 12.0.0-beta.35) throws AccessDeniedException when you try to use `Files.copy(azureBlobSource, localDestinationFile)`
Reason is this snippet in the beginning of the method:
```java
if (accessModes != null && accessModes.length != 0) {
throw LoggingUtility.logError(ClientLoggerHolder.LOGGER,
new AccessDeniedException("The access cannot be determined."));
}
```
Problem is that `java.nio.file.CopyMoveHelper` invokes it like this:
```java
provider.checkAccess(source, AccessMode.READ);
```
Is it possible to change condition to following instead?
```java
if (accessModes != null && accessModes.length != 0 && (accessModes.length != 1 || accessModes[0] != AccessMode.READ)) {
throw LoggingUtility.logError(ClientLoggerHolder.LOGGER,
new AccessDeniedException("The access cannot be determined."));
}
```
Contributor guide
Assessment
This issue has not been assessed yet.