This is a Java servlet filter (as per Servlet API 2.3). The idea behind this filter is very simple.
Filter lets you stop downloading files from your site by users that are not visiting your site itself.
For example, if someone try to download a file from your site: http://your_site/your_file.zip by click on that link
on the another site: http://some_site/list_of_files.htm. In this case REFERER header in HTTP request
points to some_site. And vice versa if your visitor clicks on the same link on your site
REFERER header points to your site. So filter lets you set a mandatory value for How to use it:
a) download forcerefererflt.jar and save it in WEB-INF/lib
b) describe this filter in web.xml. Parameters are:
referer describes a space separated list of possible mandate values for REFERER header. You can use
regular expressions here
For example:
c) describe a mapping for this filter in web.xml
in this case filter will be on for for file myfile.zip.
So for any request to this file, like this: http://your_server/myfile.zip filter
will check out referer field. And users that are not coming from license.jsp file will
be redirected to that page.
Also you may exclude some of your files from the processing. Parameter
exclude contains a commas separated list of files excluded
from the processing. E.g.:
This filter may prevent bandwidth theft or "hotlinking" (a direct linking to your web site's files:
images, video, etc.). An example would be using an <img> tag to display a JPEG
image from your site on someone else's web page etc. Just describe in referer parameter your own host
(and probably the search engines) and map filter to image files.
For downloading:
Force referer filter: forcerefererflt.jar
See also JSOS - the largest collection of servlets and filters.
|
Also in JSOS:
|