GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — trouble with changing an access for blobs · Issue #1710 · googleapis/google-cloud-java

trouble with changing an access for blobs #1710

New issue
Copy link
New issue
Copy link
Closed
Closed
trouble with changing an access for blobs#1710
Copy link
Assignees
dev-priporov
Labels
api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

Description

@dev-priporov
dev-priporov
opened on Mar 8, 2017
Issue body actions

I work with Google Storage API via java and I use 0.9.4-alpha(before was 0.9.2-alpha ) version. When I create a blob, I use this code and it works correctly, I get different access levels for a new blob:

bucket.create(
    getFileName(req),
    fileToInputStream(req),
    Bucket.BlobWriteOption.predefinedAcl(getPredefinedAcl(req.getAccessType()))
);

but I need to have an opportunity of changing an access to particular files. Well, I have supposed that it seems like this, because I didn't find any examples and information in the documentation:

blob.update(
    Storage.BlobTargetOption.predefinedAcl(Storage.PredefinedAcl.PRIVATE)
);

but this piece of code throws an exception: com.google.cloud.storage.StorageException: Cannot provide both a predefinedAcl and access controls. and I get a message:

{
    "code" : 409,
    "errors" : [ {
    "domain" : "global",
    "message" : "Cannot provide both a predefinedAcl and access controls.",
    "reason" : "conflict"
    } ],
    "message" : "Cannot provide both a predefinedAcl and access controls."
}

It seems to me it's weird because I can pass Storage.BlobTargetOption.predefinedAcl in update method, but it doesn't work(perhaps I have not to pass predefinedAcl there ...??).
Also I have tried to change an access via com.google.cloud.storage.Acl class but I got another exception.
I suppose I do something wrong and it isn't a bug, but stackoverflow didn't help me and absence of examples is really problem for me now. I should be grateful you for help.

Activity

  1. garrettjonesgoogle
    added
    api: storageIssues related to the Cloud Storage API.
    type: questionRequest for information or clarification. Not an issue.
    on Mar 8, 2017
  2. dev-priporov commented on Mar 9, 2017

    @dev-priporov
    dev-priporov
    on Mar 9, 2017
    Author
    More actions

    well, I found a solution:

    Acl acl = Acl.of(Acl.User.ofAllUsers(), Acl.Role.READER);
    blob.createAcl(acl);
    blob.deleteAcl(acl.getEntity());
    

    But I think it's not as obvious as it can

  3. dev-priporov
    closed this as completedon Mar 9, 2017
  4. JustinBeckwith
    assigned
    dev-priporov
    on Feb 1, 2021
  5. meltsufin
    added a commit that references this issue on Dec 22, 2025

    chore: Update generation configuration at Wed Oct 23 02:23:51 UTC 2024 (

    93f5ae9
  6. chingor13
    added a commit that references this issue on Jan 22, 2026

    chore(deps): update dependency com.google.cloud:google-cloud-datastor…

    124f8b2
  7. chingor13
    added a commit that references this issue on Feb 24, 2026

    chore(deps): update dependency ch.qos.logback:logback-core to v1.5.18 (…

    e2dad7d
  8. suztomo
    added a commit that references this issue on Mar 11, 2026

    chore: Update generation configuration at Wed Oct 23 02:23:51 UTC 2024 (

    a7e2d55
  9. chingor13
    added a commit that references this issue on Mar 12, 2026

    chore(deps): update dependency ch.qos.logback:logback-core to v1.5.18 (…

    2707b00
  10. suztomo
    added a commit that references this issue on Mar 23, 2026

    deps: update dependency com.fasterxml.jackson.core:jackson-databind t…

    6a85879
  11. suztomo
    added a commit that references this issue on Mar 30, 2026

    deps: update dependency com.google.apis:google-api-services-storage t…

    447544f
  12. lqiu96
    added a commit that references this issue on Apr 1, 2026

    deps: update dependency com.google.apis:google-api-services-storage t…

    4f4fb19
  13. meltsufin
    added 4 commits that reference this issue on Apr 29, 2026

    deps: update dependency org.graalvm.buildtools:native-maven-plugin to…

    9764c3f

    chore(main): release 1.133.0 (#2206)

    a3b6539

    deps: update dependency org.graalvm.buildtools:native-maven-plugin to…

    e79f846

    chore(main): release 1.133.0 (#2206)

    1180af9
  14. benjaminp
    added 2 commits that reference this issue on Jul 13, 2026

    docs: make delete examples consistent with other languages (googleapi…

    65bea9b

    chore(main): release 2.20.4 (googleapis#1701)

    801fc60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dev-priporov
    dev-priporov

Labels

api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.