|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.ecyrd.jspwiki.dav.WebdavServlet
com.ecyrd.jspwiki.attachment.AttachmentServlet
public class AttachmentServlet
This is the chief JSPWiki attachment management servlet. It is used for both uploading new content and downloading old content. It can handle most common cases, e.g. check for modifications and return 304's as necessary.
Authentication is done using JSPWiki's normal AAA framework.
This servlet is also capable of managing dynamically created attachments.
Field Summary | |
---|---|
protected static long |
DEFAULT_EXPIRY
Default expiry period is 1 day |
Fields inherited from class com.ecyrd.jspwiki.dav.WebdavServlet |
---|
SC_FAILED_DEPENDENCY, SC_INSUFFICIENT_STORAGE, SC_LOCKED, SC_MULTISTATUS, SC_PROCESSING, SC_UNPROCESSABLE |
Constructor Summary | |
---|---|
AttachmentServlet()
|
Method Summary | |
---|---|
void |
doGet(HttpServletRequest req,
HttpServletResponse res)
Serves a GET with two parameters: 'wikiname' specifying the wikiname of the attachment, 'version' specifying the version indicator. |
protected void |
doOptions(HttpServletRequest req,
HttpServletResponse res)
Implements the OPTIONS method. |
void |
doPost(HttpServletRequest req,
HttpServletResponse res)
Grabs mime/multipart data and stores it into the temporary area. |
void |
doPropFind(HttpServletRequest req,
HttpServletResponse res)
Implements the PROPFIND method. |
void |
doPut(HttpServletRequest req,
HttpServletResponse res)
|
protected boolean |
executeUpload(WikiContext context,
InputStream data,
String filename,
String errorPage,
String parentPage,
String changenote,
long contentLength)
|
void |
init(ServletConfig config)
Initializes the servlet from WikiEngine properties. |
protected String |
upload(HttpServletRequest req)
Uploads a specific mime multipart input set, intercepts exceptions. |
Methods inherited from class com.ecyrd.jspwiki.dav.WebdavServlet |
---|
doCopy, doLock, doMkCol, doMove, doPropPatch, doUnlock, service |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doTrace, getLastModified, 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 |
---|
protected static final long DEFAULT_EXPIRY
Constructor Detail |
---|
public AttachmentServlet()
Method Detail |
---|
public void init(ServletConfig config) throws ServletException
init
in interface Servlet
init
in class GenericServlet
ServletException
public void doPropFind(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
doPropFind
in class WebdavServlet
req
- The servlet requestres
- The servlet response
IOException
- If input/output fails
ServletException
- If the servlet has issuesprotected void doOptions(HttpServletRequest req, HttpServletResponse res)
doOptions
in class HttpServlet
req
- The servlet requestres
- The servlet responsepublic void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
doGet
in class HttpServlet
IOException
ServletException
public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
The input to this servlet is generated by an HTML FORM with two parts. The first, named 'page', is the WikiName identifier for the parent file. The second, named 'content', is the binary content of the file.
doPost
in class HttpServlet
IOException
ServletException
public void doPut(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
doPut
in class HttpServlet
IOException
ServletException
protected String upload(HttpServletRequest req) throws RedirectException, IOException
req
- The servlet request
RedirectException
- If there's an error and a redirection is needed
IOException
- If upload fails
org.apache.commons.fileupload.FileUploadException
protected boolean executeUpload(WikiContext context, InputStream data, String filename, String errorPage, String parentPage, String changenote, long contentLength) throws RedirectException, IOException, ProviderException
context
- the wiki contextdata
- the input stream datafilename
- the name of the file to uploaderrorPage
- the place to which you want to get a redirectionparentPage
- the page to which the file should be attachedchangenote
- The change notecontentLength
- The content length
true
if upload results in the creation of a new page;
false
otherwise
RedirectException
- If the content needs to be redirected
IOException
- If there is a problem in the upload.
ProviderException
- If there is a problem in the backend.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |