Package org.mycore.services.zipper
Class MCRZipServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.mycore.frontend.servlets.MCRServlet
org.mycore.services.zipper.MCRCompressServlet<org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream>
org.mycore.services.zipper.MCRZipServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
public class MCRZipServlet
extends MCRCompressServlet<org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream>
Uses ZIP format to deliver requested content.
Deflater.BEST_COMPRESSION
is used for compression.- Author:
- Thomas Scheffler
- See Also:
-
Field Summary
Fields inherited from class org.mycore.services.zipper.MCRCompressServlet
KEY_OBJECT_ID, KEY_PATH
Fields inherited from class org.mycore.frontend.servlets.MCRServlet
ATTR_MYCORE_SESSION, CURRENT_THREAD_NAME_KEY, INITIAL_SERVLET_NAME_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream
createContainer
(jakarta.servlet.ServletOutputStream sout, String comment) protected void
disposeContainer
(org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream container) protected String
protected String
protected void
sendCompressedDirectory
(MCRPath file, BasicFileAttributes attrs, org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream container) protected void
sendCompressedFile
(MCRPath file, BasicFileAttributes attrs, org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream container) protected void
sendMetadataCompressed
(String fileName, byte[] content, long lastModified, org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream container) Methods inherited from class org.mycore.services.zipper.MCRCompressServlet
getFilename, render, think
Methods inherited from class org.mycore.frontend.servlets.MCRServlet
allowCrossDomainRequests, buildRedirectURL, cleanupMCRSession, doGet, doGet, doGetPost, doPost, doPost, getErrorI18N, getLastModified, getLayoutService, getProperty, getReferer, getServletBaseURL, getSession, handleException, init, initializeMCRSession, reportException, toReferrer, toReferrer
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, service, service
Methods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
MCRZipServlet
public MCRZipServlet()
-
-
Method Details
-
sendCompressedDirectory
protected void sendCompressedDirectory(MCRPath file, BasicFileAttributes attrs, org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream container) throws IOException - Specified by:
sendCompressedDirectory
in classMCRCompressServlet<org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream>
- Throws:
IOException
-
sendCompressedFile
protected void sendCompressedFile(MCRPath file, BasicFileAttributes attrs, org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream container) throws IOException - Specified by:
sendCompressedFile
in classMCRCompressServlet<org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream>
- Throws:
IOException
-
sendMetadataCompressed
protected void sendMetadataCompressed(String fileName, byte[] content, long lastModified, org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream container) throws IOException - Specified by:
sendMetadataCompressed
in classMCRCompressServlet<org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream>
- Throws:
IOException
-
getMimeType
- Specified by:
getMimeType
in classMCRCompressServlet<org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream>
-
getFileExtension
- Specified by:
getFileExtension
in classMCRCompressServlet<org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream>
-
createContainer
protected org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream createContainer(jakarta.servlet.ServletOutputStream sout, String comment) - Specified by:
createContainer
in classMCRCompressServlet<org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream>
-
disposeContainer
protected void disposeContainer(org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream container) throws IOException - Specified by:
disposeContainer
in classMCRCompressServlet<org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream>
- Throws:
IOException
-