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 — java-docs-samples/storage/storage-transfer at master · RobertDuy/java-docs-samples

Expand file tree

/

storage-transfer

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

storage-transfer

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src
src
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline

Transfer Service sample using Java

This app creates two types of transfers using the Transfer Service tool.

Prerequisites

  1. Set up a project on Google Developers Console.
  2. Go to the Developers Console and create or select your project. You will need the project ID later.
  3. Within Developers Console, select APIs & auth > Credentials.
  4. Select Add credentials > Service account > JSON key.
  5. Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to point to your JSON key.
  6. Add the Storage Transfer service account as an editor of your project storage-transfer-5031963314028297433@partnercontent.gserviceaccount.com
  7. Set up gcloud for application default credentials.
  8. gcloud components update
  9. gcloud auth login
  10. gcloud config set project PROJECT_ID

Transfer from Amazon S3 to Google Cloud Storage

Creating a one-time transfer from Amazon S3 to Google Cloud Storage.

  1. Set up data sink.
  2. Go to the Developers Console and create a bucket under Cloud Storage > Storage Browser.
  3. Set up data source.
  4. Go to AWS Management Console and create a bucket.
  5. Under Security Credentials, create an IAM User with access to the bucket.
  6. Create an Access Key for the user. Note the Access Key ID and Secret Access Key.
  7. In AwsRequester.java, fill in the user-provided constants.
  8. Run with mvn compile and mvn exec:java -Dexec.mainClass="com.google.cloud.storage.storagetransfer.samples.AwsRequester"
  9. Note the job ID in the returned Transfer Job.

Transfer data from a standard Cloud Storage bucket to a Cloud Storage Nearline bucket

Creating a daily transfer from a standard Cloud Storage bucket to a Cloud Storage Nearline bucket for files untouched for 30 days.

  1. Set up data sink.
  2. Go to the Developers Console and create a bucket under Cloud Storage > Storage Browser.
  3. Select Nearline for Storage Class.
  4. Set up data source.
  5. Go to the Developers Console and create a bucket under Cloud Storage > Storage Browser.
  6. In NearlineRequester.java, fill in the user-provided constants.
  7. Run with mvn compile and mvn exec:java -Dexec.mainClass="com.google.cloud.storage.storagetransfer.samples.NearlineRequester"
  8. Note the job ID in the returned Transfer Job.

Checking the status of a transfer

  1. In RequestChecker.java, fill in the user-provided constants. Use the Job Name you recorded earlier.
  2. Run with mvn compile and mvn exec:java -Dexec.mainClass="com.google.cloud.storage.storagetransfer.samples.RequestChecker"
You are visitor 01402792 — 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.