The Storage sample application demonstrates some common operations with Google Cloud Storage and is compatible with Native Image compilation.
Navigate to this directory in a new terminal.
-
Compile the application using the Native Image Compiler. This step may take a few minutes.
mvn package -P native
-
Run the application:
./target/storage-sample
-
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