Closed bergwerf closed 1 year ago
See fake-gcs-server issue, https://github.com/fsouza/fake-gcs-server/issues/1166
When a resumable upload session is started in Google Cloud Storage, the redirect Location
returned for all subsequent operations is a fully qualified URL. It seems that "fake-gcs-server" is providing a relative Location
instead of a fully qualified one.
The returned Location
must specify the scheme and host http://localhost:8080/upload/storage/v1/b/bucket/o?uploadType=resumable&name=world&upload_id=b25b68443dfb4363e11f0d58761fc6be
, once that is done the java library will PUT to the running fake-gcs-server.
An update was pushed to "fake-gcs-server" which resolved this issue for me.
It appears I am currently not able to implement streamed file uploading to Google Cloud Storage via the Java API.
OS type/version: Debian 11.
Java version: Java 17 OpenJDK.
Steps to reproduce
Run the Google Cloud Storage mock server provided by https://github.com/fsouza/fake-gcs-server
Run the program at https://github.com/bergwerf/cratedb_gcs/tree/main/gcs_demo
Code example
See https://github.com/bergwerf/cratedb_gcs/blob/3a0a1521f7d82286f2a0ba51f0939dff369c8b13/gcs_demo/src/main/java/nl/hbergwerf/example/Main.java#L83
Stack trace
External references such as API reference guides
Any additional information below
Related: https://github.com/googleapis/java-storage/issues/40