I am trying to "upload" an array of bytes to a local GAE / J development server (1.8.1, Eclipse Juno) using the Google Cloud Storage Client Library:
byte[] byteContent = new byte[] {1, 2, 3, 4, 5}; GcsFilename fileName = new GcsFilename("MyBucket", "foo"); GcsOutputChannel outputChannel = GcsServiceFactory.createGcsService().createOrReplace(fileName, GcsFileOptions.getDefaultInstance()); outputChannel.write(ByteBuffer.wrap(byteContent)); outputChannel.close();
Attempting this causes the following exception:
WARNING: Caught IOException while attempting to write blob java.io.FileNotFoundException: C:\dev\workspace\gaeTestProjekt\war\WEB-INF\appengine-generated\encoded_gs_key:L2dzL015QnVja2V0L2Zvbw (The filename, directory name, or volume label syntax is incorrect)
This makes sense, given the existence of an extra colon in the name of the target file (encoded_gs_key: L2dzL015QnVja2V0L2Zvbw).
The question is how to prevent the local development server from trying to create an invalid file name?
source share