I wrote a file to Google Cloud Storage using the instructions given here:
https://developers.google.com/appengine/docs/java/googlestorage/overview
The code runs and executes successfully, however, after logging into my Storage account, I don't see the newly written file in my bucket.
Any ideas as to why?
So this is the export code:
This is the code I am using:
        try {   
            // Get the file service
            FileService fileService = FileServiceFactory.getFileService();
            /**
             * Set up properties of your new object
             * After finalizing objects, they are accessible
             * through Cloud Storage with the URL:
             * http://storage.googleapis.com/my_bucket/my_object
             */
            GSFileOptionsBuilder optionsBuilder = new GSFileOptionsBuilder()
              .setBucket(bucket)
              .setKey(key)
              .setAcl("public-read");
            // Create your object
            AppEngineFile writableFile = fileService
                    .createNewGSFile(optionsBuilder.build());
            // Open a channel for writing
            boolean lockForWrite = false;
            FileWriteChannel writeChannel = fileService.openWriteChannel(
                    writableFile, lockForWrite);
            // For this example, we write to the object using the
            // PrintWriter
            PrintWriter out = new PrintWriter(Channels.newWriter(
                    writeChannel, "UTF8"));
            Iterator<String> it = spRes.iterator();
            while (it.hasNext()) {
                out.println(it.next());
            }
            // Close without finalizing and save the file path for writing
            // later
            out.close();
            String path = writableFile.getFullPath();
            // Write more to the file in a separate request:
            writableFile = new AppEngineFile(path);
            // Lock the file because we intend to finalize it and
            // no one else should be able to edit it
            lockForWrite = true;
            writeChannel = fileService.openWriteChannel(writableFile,
                    lockForWrite);
            // Now finalize
            writeChannel.closeFinally();
        } catch (IOException e) {
            result = "Failed to export";
            e.printStackTrace();
        }