Class AbstractFileServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.uberfire.server.BaseFilteredServlet
-
- org.guvnor.common.services.backend.file.upload.AbstractFileServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public abstract class AbstractFileServlet extends org.uberfire.server.BaseFilteredServletThis is for dealing with assets that have an attachment (ie assets that are really an attachment).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_CLIENT_IDprotected org.jboss.errai.bus.server.api.SessionProvidersessionProvider
-
Constructor Summary
Constructors Constructor Description AbstractFileServlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.uberfire.backend.vfs.PathconvertPath(String fullPath)Convert fullPath into a Pathprotected abstract org.uberfire.backend.vfs.PathconvertPath(String fileName, String contextPath)Convert fileName and contextPath into a Pathprotected abstract voiddoCreate(org.uberfire.backend.vfs.Path path, InputStream data, javax.servlet.http.HttpServletRequest request, String comment)Create a new resourceprotected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)doGet acting like a dispatcher.protected abstract InputStreamdoLoad(org.uberfire.backend.vfs.Path path, javax.servlet.http.HttpServletRequest request)Load resourceprotected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Posting accepts content of various types.protected abstract voiddoUpdate(org.uberfire.backend.vfs.Path path, InputStream data, javax.servlet.http.HttpServletRequest request, String comment)Update a resourceprotected StringgetSessionId(javax.servlet.http.HttpServletRequest request, org.jboss.errai.bus.server.api.SessionProvider sessionProvider)voidinit(javax.servlet.ServletConfig config)protected voidprocessAttachmentDownload(String url, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
DEFAULT_CLIENT_ID
public static final String DEFAULT_CLIENT_ID
- See Also:
- Constant Field Values
-
sessionProvider
protected org.jboss.errai.bus.server.api.SessionProvider sessionProvider
-
-
Method Detail
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException- Specified by:
initin interfacejavax.servlet.Servlet- Overrides:
initin classorg.uberfire.server.BaseFilteredServlet- Throws:
javax.servlet.ServletException
-
doLoad
protected abstract InputStream doLoad(org.uberfire.backend.vfs.Path path, javax.servlet.http.HttpServletRequest request)
Load resource- Parameters:
path-request-- Returns:
-
doCreate
protected abstract void doCreate(org.uberfire.backend.vfs.Path path, InputStream data, javax.servlet.http.HttpServletRequest request, String comment)Create a new resource- Parameters:
path-data-request-comment-
-
doUpdate
protected abstract void doUpdate(org.uberfire.backend.vfs.Path path, InputStream data, javax.servlet.http.HttpServletRequest request, String comment)Update a resource- Parameters:
path-data-request-comment-
-
convertPath
protected abstract org.uberfire.backend.vfs.Path convertPath(String fileName, String contextPath) throws URISyntaxException
Convert fileName and contextPath into a Path- Parameters:
fileName-contextPath-- Returns:
- Throws:
URISyntaxException
-
convertPath
protected abstract org.uberfire.backend.vfs.Path convertPath(String fullPath) throws URISyntaxException
Convert fullPath into a Path- Parameters:
fullPath-- Returns:
- Throws:
URISyntaxException
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOExceptionPosting accepts content of various types.- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOExceptiondoGet acting like a dispatcher.- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
processAttachmentDownload
protected void processAttachmentDownload(String url, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
- Throws:
IOException
-
getSessionId
protected String getSessionId(javax.servlet.http.HttpServletRequest request, org.jboss.errai.bus.server.api.SessionProvider sessionProvider)
-
-