aspose file tools*
The moose likes Web Services and the fly likes Web-service: resume download BIG file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Web-service: resume download BIG file" Watch "Web-service: resume download BIG file" New topic
Author

Web-service: resume download BIG file

surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

Hello partners!
I develop Android app that will need to download large file from Java web-service.
The app can lose Internet connection while downloading.
Is it possible to continue downloading a file from the middle?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38392
    
  23
Yes, but I don’t know how. Maybe they will know on the web services forum.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Is this a commercial web service or one you have created?

Does the web service use SOAP or is it in RESTful style?

Bill
surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

This is a service that I will create by myself. Actually I'm just planning how to build it the way it will be able to resume download.
So I can use any of those (SOAP, RESTful), just need to know if there any technology available to resume download.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
I don't know of any "toolkit" but it would be simple to program in the RESTful style because the "technology" built into the standard HTTP request headers lets you specify a range of bytes to be sent.

The standard Java library will of course let you find the size of a file and start reading from any point (java.io.RandomAccessFile) on the server.

Bill
surlac surlacovich
Ranch Hand

Joined: Mar 12, 2013
Posts: 296

Thanks William.
So you talking about adding "offset" and "count" parameters (in bytes) to the web-service, to start download from the middle.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Think of a series of request/response transactions instead of a single "download" request.

It would be up to the client to keep track of which chunks are still missing from the total file.

BitTorrent is, of course, based on this idea of assembling a BIG data file from independently handled chunks.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web-service: resume download BIG file