jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sofiane Soulfly <saw...@hotmail.com>
Subject Re: Download file from Swift
Date Tue, 23 Dec 2014 11:05:47 GMT

 I am using 1.8.x. I am testing your code now.
On 22.12.2014 18:01, Everett Toews wrote:
> What version of jclouds are you using?
>
> Try this…
>
> ObjectApi objectApi = cloudFiles.getObjectApi(REGION, CONTAINER);
> SwiftObject swiftObject = objectApi.get("uploadObjectFromFile.txt”);
>
> // Write the object to a file
> File file = File.createTempFile("uploadObjectFromFile", ".txt");
> BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(file));
> ByteStreams.copy(swiftObject.getPayload().openStream(), outputStream);
>
> Everett
>
>
> On Dec 22, 2014, at 6:23 AM, Sofiane Soulfly <sawdef@hotmail.com> wrote:
>
>> Hello everybody,
>>
>> after I uploaded successfully a text file to Swift, now I want download
>> that file into my file system.
>> I tried with ObjectApi.get but nothing was downloaded.
>> Thank you.
>>
>> Regards,
>>
>> SB


Mime
View raw message