title: Enable resuming interrupt download in REST web service using Java
body: <p>I am writing a REST web service for clients to download large data files. As part of this, I would like to implement a feature to enable resuming interrupt downloads in case an exception occurs or the connection is lost on the original request.</p>
  
  <p>I did some research online and found that supporting Range/If-Range properties in the request header might be the solution, as indicated in <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" rel="nofollow">http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html</a>.</p>
  
  <p>My question are</p>
  
  <ol>
  <li><p>In the scope of REST web service, is it the most commonly used and best practice to support Range/If-Range properties in the client HTTP request header, or just pass the byte offset as a query parameter in the client GET request, e.g., <strong>hostname:port/download?token=?byteoffset=?</strong>?</p></li>
  <li><p>If taking the former approach, on the server side, is there a standard way to handle request with Range field in JAX-RS specification (I am using Java)? The straightforward way is to just open an InputStream from the file and bypass the given # of bytes.</p></li>
  </ol>