There are two parts to support renewable downloads:
If you are serving a static resource, it is best to use a proxy server, such as Apache, to handle the download. If the proxy server is not a parameter, you can probably find the servlet that is associated with your application server; for example, Tomcat has a DefaultServlet . The disadvantage of this option is that it creates a tight dependency between your application and the application server, which may be unacceptable.
If you decide to tip over, I recommend taking a look at the Apache HTTP components . This is a good API that simplifies working with HTTP requests and responses.
source share