File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web-service: resume download BIG file

 
surlac surlacovich
Ranch Hand
Posts: 296
Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47232
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 296
Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 296
Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13045
6
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic