Komal
Komal

Reputation: 89

Download file using Azure Storage with resume download

I want to resumable a file download from the Azure server.

I've tried with many third-party libraries. i.e PRDownloader, Fetch but Azure file is restart download while network issue OR any.

Referred c# code

var blobRequestOptions = new Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions
            {
                RetryPolicy = new Microsoft.WindowsAzure.Storage.RetryPolicies.ExponentialRetry(TimeSpan.FromSeconds(5), 3),
                MaximumExecutionTime = TimeSpan.FromMinutes(60),
                ServerTimeout = TimeSpan.FromMinutes(60),
                StoreBlobContentMD5 = true
            };

But not getting how it'll work in android. Can any one help to short it out. Help will be appreciate.

Upvotes: 0

Views: 771

Answers (1)

George Chen
George Chen

Reputation: 14324

This is the BlobRequestOptions class, there is a same method setTimeoutIntervalInMs like the ServerTimeout property.

And about the example about setting the BlobRequestOptions properties, you could refer to this github code: MaximumExecutionTimeTests.java, it sets the MaximumExecutionTime and TimeoutInterval.

So you could combine the example with setRetryPolicyFactory to achieve the same effect like the c# code you post.

Upvotes: 0

Related Questions