Download file using Azure Storage with resume download

737 views Asked by At

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.

1

There are 1 answers

0
George Chen On

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.