This component lets you support the downloading for temporary files. Suppose your application creates some file that will be available for the downloading during the restricted time and should be automatically deleted after the downloading. For example almost all of the services for the music/pictures/games downloading on the mobile phones work so. That is what this servlet is for. How to use it:
1) download tempdownloadPackage.jar and save it in WEB-INF/lib
2) describe TempDownload servlet in your web.xml file
3) define a mapping:
and now you can use it:
servlet will download this file from the server. By default servlet will
search file in the root (docBase) directory of your servlet container. You may set
an initial parameter described another directory on your server. Parameter name
is dir. For example:
and this directory (file store) could be located even the outside of your web application.
Also you can provide the following parameters for this servlet:
ttl - describes a time (in seconds) when any file will be available for the downloading
after the creation. Default value is 86400 (24 hours).
Note: servlet may clean the directory during the startup!
See also JSOS - the largest collection of servlets and filters.
Also in Coldtags: