• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Web-service: resume download BIG file

 
Ranch Hand
Posts: 296
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, but I don’t know how. Maybe they will know on the web services forum.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13078
6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic