|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--javazoom.download.DownloadServlet
This class implements a servlet to download files through DownloadImpl.
| Field Summary | |
static java.lang.String[] |
BLACKLIST
Characters blacklist for secured filename : |
static java.lang.String |
CUSTOMPARAMETER
Parameter name for custom field : Default is custom |
static java.lang.String |
DOWNLOADBEANNAME
Bean name for JSP : Default is downloadbean |
static java.lang.String |
FILENAMEPARAMETER
Parameter name for download : Default is name |
static boolean |
SECUREFILENAME
Enables/Disables filename security : Default is true |
| Constructor Summary | |
DownloadServlet()
|
|
| Method Summary | |
java.lang.String |
checkFilename(java.lang.String filename)
Removes UnSafe characters in URL (for instance %2E%2E/ means ../) An Download4J malicious user could try to download files outside the downloadRoot. |
void |
destroy()
Clean up resources. |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Processes HTTP Get. |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Processes HTTP Post. |
void |
init()
Initializes DownloadServlet. |
void |
performDownload(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Processes the download. |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.lang.String DOWNLOADBEANNAME
public static java.lang.String FILENAMEPARAMETER
public static java.lang.String CUSTOMPARAMETER
public static boolean SECUREFILENAME
public static java.lang.String[] BLACKLIST
| Constructor Detail |
public DownloadServlet()
| Method Detail |
public void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletException
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
doGet in class javax.servlet.http.HttpServletrequest - incoming user's request.response - user's response
javax.servlet.ServletException
java.io.IOException
public void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
doPost in class javax.servlet.http.HttpServletrequest - incoming user's request.response - user's response
javax.servlet.ServletException
java.io.IOException
public void performDownload(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
request - HttpRequest from browserresponse - HttpResponse sent to browser
javax.servlet.ServletException
java.io.IOExceptionpublic java.lang.String checkFilename(java.lang.String filename)
filename - from URL
public void destroy()
destroy in interface javax.servlet.Servletdestroy in class javax.servlet.GenericServlet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||