main
  • About
  • Civil Engineering
    • Interview questions
    • Bridge design
  • Google Cloud
    • Code samples
    • kafka
    • Cloud Run
    • persistent disks
    • Spinnaker
    • Assessment questions
    • IAM
    • Cloud Storage
    • VPC
    • Cost optimization
    • Compute Engine
    • App Engine
    • Cloud Vision
    • Spanner
    • Cloud SQL
    • Solutions
      • Static IP - WIP
      • Network performance
      • Building a VPN
      • Build a streaming app
      • ML train with taxi data
    • Dataproc
    • Dataprep
    • BigTable
    • Cloud Fusion
    • Data flow
    • CloudFront
    • APIGEE
    • BigQuery
    • Cloud logging
    • Pubsub
    • Identity Aware Proxy
    • Data center migration
    • Deployment Manager
    • Kubeflow
    • Kubernetes Engine
    • Istio
    • Read the following
    • Storage for cloud shell
    • kms
    • kpt
    • Hybrid cloud with Anthos
    • helm
    • Architecture
    • terraform
    • Network
    • Data studio
    • Actions
    • Jenkins
  • Data Processing
    • Data Lake
    • Data ingestion
    • Data Cleaning - Deduplication
    • Data Cleaning - Transformation
    • Data cleaning - rule definition
    • ETL
  • Machine Learning
    • Tensorflow
    • Tensorflow tips
    • Keras
    • Scikit-learn
    • Machine learning uses
    • Working with Pytorch
    • Federated learning
  • AWS cloud
    • Billing
    • Decrease volume size of EC2
    • Run CVE search engine
    • DataSync
    • EC2 spot instances
  • Java
    • Java
    • NIO
    • System Design
      • Zero trust framework
    • Collections
  • Azure
    • Enterprise Scale
    • API
    • Resource group
    • Create an sql database
  • UBUNTU
    • No Release file
    • STRATO blockchain
    • iperf
    • Rsync
    • curl
    • Shell
    • FAQ - git
  • PH test
    • Syllabus
    • Opportunities
    • Aptitude test
  • Development
    • Course creation
    • web.dev
    • docfx template
  • npm
  • Docker Desktop
  • Nginx
  • English rules
  • Confluent
  • sanity theme
  • Java Native Interface tutorial
  • Putty
  • Personal website host
  • Google search SEO
  • Reading a textbook
  • DFCC Progress
  • STORAGE
    • Untitled
  • Services Definition
    • Cloud VPN and routing
  • Microservices design and Architecture
    • Untitled
  • Hybrid network architecture
    • Untitled
  • Deployment
    • Untitled
  • Reliability
    • Untitled
  • Security
    • Untitled
  • Maintenance and Monitoring
    • Peering
  • Archive
    • parse dml to markdown
Powered by GitBook
On this page
  • Access control lists
  • Roles

Was this helpful?

  1. Google Cloud

Cloud Storage

PreviousIAMNextVPC

Last updated 4 years ago

Was this helpful?

Java api reference -

Usages

static Storage storage = StorageOptions.getDefaultInstance().getService();

@Value("${google.storage.bucket}")
private String bucketname;

BlobInfo blobInfo = storage.create(BlobInfo.newBuilder(bucketname, fileName).setContentType(file.getContentType()).setAcl(new ArrayList<>(
            Arrays.asList(Acl.of(Acl.User.ofAllUsers(),
                                Acl.Role.READER)))).build(), file.getInputStream());

Access control lists

JSON API

XML API/gsutil

Description

private

private

Gives the bucket or object owner OWNER permission for a bucket or object.

bucketOwnerRead

bucket-owner-read

Gives the object owner OWNER permission, and gives the bucket owner READER permission. This is used only with objects.

  • Avoid setting ACLs that result in inaccessible objects.

    An inaccessible object is an object that cannot be downloaded (read) and can only be deleted. This can happen when the owner of an object leaves a project without granting anyone else OWNER or READER permission on the object. To avoid this problem, you can use the bucket-owner-read or bucket-owner-full-control predefined ACLs when you or anyone else uploads objects to your buckets.

Roles

.

.

set permissions with cloud console -

https://cloud.google.com/storage/docs/access-control/lists#predefined-acl
https://cloud.google.com/storage/docs/access-control/iam-permissions
https://cloud.google.com/storage/docs/cloud-console#_bucketpermission
https://googleapis.dev/java/google-cloud-storage/latest/index.html