SecureDownload servlet v. 1.4

A simple component you may use for the secure files downloading. Servlet lets you hide from the visitors the location for the downloaded file. The usage is:


Servlet will find this some_key in the text (properties file) and get the real location (as well as a name) for the downloaded file. And your configuration file will be provided as an initial parameter for this servlet. Of course, You can update content of this file at any time. Parameter name is base. Also you can define an initial parameter
expires. It describes a caching time (in seconds) for the downloaded resource.

a) copy secureDownloadPackage.jar into WEB-INF/lib directory

b) describe this servlet in your web.xml file:


c) describe a mapping for this servlet in your web.xml file:


Properties file is a text file, each line describes one file in the form of

Empty lines and any line starts with # or // are ignored. You can use file path as well as URI here. For example:


In this case for example http://your_host/servlet/SecureDownload?key2 will actually download the file from http://myhost/mydir/picture.mp3

Note: the evaluation version supports up to 5 keys in the properties file.

For downloading:

servlet: secureDownloadPackage.jar  
 © Coldbeans    Comments?
See also JSOS - the largest collection of servlets and filters.

Also in Coldtags: