Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Storage Sample Application with Native Image

The Storage sample application demonstrates some common operations with Google Cloud Storage and is compatible with Native Image compilation.

Setup Instructions

  1. Follow the GCP Project Authentication and Native Image Setup Instructions.

  2. Enable the Cloud Storage APIs.

Run with Native Image Compilation

Navigate to this directory in a new terminal.

  1. Compile the application using the Native Image Compiler. This step may take a few minutes.

    mvn package -P native
    
  2. Run the application:

    ./target/storage-sample
    
  3. The application will run through basic Cloud Storage operations of creating, reading, and deleting Cloud Storage resources.

    You can manually manage Cloud Storage resources through Google Cloud Console to verify that the resources are cleaned up.

    Creating bucket nativeimage-sample-bucket-7221f161-688c-4a7a-9120-8900d20f0802
    Write file to bucket.
    Reading the file that was written...
    Successfully wrote to file: Hello World!
    Cleaning up resources...
    Deleted file nativeimage-sample-file-5d927aaf-cb03-41de-8383-696733893db5
    Deleted bucket nativeimage-sample-bucket-7221f161-688c-4a7a-9120-8900d20f0802