Class Upload
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.maplander.backend.controller.servlet.Upload
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class Upload
extends javax.servlet.http.HttpServlet
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doDelete
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) deletes a file in doDelete servlet.protected void
doPost
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) upload a file in doPost servlet.Methods inherited from class javax.servlet.http.HttpServlet
doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
Constructor Details
-
Upload
public Upload()
-
-
Method Details
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException upload a file in doPost servlet. It needs an file Part; fileName, path and isImage passed in HttpServletRequest as query params. Default fileName is file-timestamp. Default path is default. Default isImage is false.- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Parameters:
req
- contains a Part; fileName, path and isImage as query params.resp
- returns in writer anEntityResponse
withFileCS
. Status are:HttpStatusCode.OK
,HttpStatusCode.BAD_REQUEST
,HttpStatusCode.INTERNAL_SERVER_ERROR
- Throws:
javax.servlet.ServletException
- ServletExceptionIOException
- IOException
-
doDelete
protected void doDelete(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException deletes a file in doDelete servlet. It needs a blobName passed in HttpServletRequest as a query param.- Overrides:
doDelete
in classjavax.servlet.http.HttpServlet
- Parameters:
req
- contains blobName.resp
- returns in writer anDefaultResponse
. Status are:HttpStatusCode.OK
,HttpStatusCode.BAD_REQUEST
,HttpStatusCode.NOT_EXISTS
- Throws:
javax.servlet.ServletException
- ServletExceptionIOException
- IOException
-