Skip to content

checkAccess operation in AzureFileSystemProvider should allow AccessMode.READ #48069

@andrej-urvantsev

Description

@andrej-urvantsev

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:

        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:

provider.checkAccess(source, AccessMode.READ);

Is it possible to change condition to following instead?

        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."));
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions