How copy folder with sub folders include files into google cloud storage with JAVA API

2 views
Skip to first unread message

VitalyTarasiuk via StackOverflow

unread,
May 1, 2016, 11:19:03 AM5/1/16
to google-appengin...@googlegroups.com

How can i make copy folder from local disk (for example: ubunto OS) with sub-folder that include several files into google cloud storage using GOOGLE API with JAVA , with the BEST PERFORMANCE.
(Something like copy & paste the local directory into google cloud using api)

File hierarchy :

  • root folder -->

    • sub folder 1 : { file1 , file2 , ...}

    • sub folder 2 : { file3 , file4 , ...}

    attached code snippet:

InputStreamContent content = new InputStreamContent(contentType, fileData);

    Storage client = new Storage.Builder(httpTransport, JSON_FACTORY, credential).setApplicationName(APPLICATION_NAME).build();
    try {

        Storage.Objects.Insert insert = client.objects().insert(bucketName, null, content);
        insert.setName(fileName);
        insert.setPredefinedAcl("publicRead");

but this code only insert file ( object) into pre-configured folder.

Any ideas please?

BR

Vitaly



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/36967903/how-copy-folder-with-sub-folders-include-files-into-google-cloud-storage-with-ja
Reply all
Reply to author
Forward
0 new messages