|
||||||||||
| 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
|
+--com.ecyrd.jspwiki.attachment.AttachmentServlet
This is a simple file upload servlet customized for JSPWiki. It receives a mime/multipart POST message, as sent by an Attachment page, stores it temporarily, figures out what WikiName to use to store it, checks for previously existing versions.
This servlet does not worry about authentication; we leave that to the container, or a previous servlet that chains to us.
| Field Summary | |
static java.lang.String |
HDR_NAME
|
static java.lang.String |
HDR_VERSION
|
| Constructor Summary | |
AttachmentServlet()
|
|
| Method Summary | |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Serves a GET with two parameters: 'wikiname' specifying the wikiname of the attachment, 'version' specifying the version indicator. |
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Grabs mime/multipart data and stores it into the temporary area. |
void |
init(javax.servlet.ServletConfig config)
Initializes the servlet from WikiEngine properties. |
protected java.lang.String |
upload(javax.servlet.http.HttpServletRequest req)
Uploads a specific mime multipart input set, intercepts exceptions. |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
destroy, 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 final java.lang.String HDR_VERSION
public static final java.lang.String HDR_NAME
| Constructor Detail |
public AttachmentServlet()
| Method Detail |
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletjavax.servlet.ServletException
public void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws java.io.IOException,
javax.servlet.ServletException
doGet in class javax.servlet.http.HttpServletjava.io.IOException
javax.servlet.ServletException
public void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws java.io.IOException,
javax.servlet.ServletException
The input to this servlet is generated by an HTML FORM with two parts. The first, named 'wikiname', is the WikiName identifier for the attachment. The second, named 'content', is the binary content of the file.
After handling, the request is forwarded to m_resultPage.
doPost in class javax.servlet.http.HttpServletjava.io.IOException
javax.servlet.ServletExceptionprotected java.lang.String upload(javax.servlet.http.HttpServletRequest req)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||