Package org.mycore.services.zipper
Class MCRTarServlet
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.tar.TarArchiveOutputStream>
org.mycore.services.zipper.MCRTarServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
public class MCRTarServlet
extends MCRCompressServlet<org.apache.commons.compress.archivers.tar.TarArchiveOutputStream>
Uses TAR format to deliver requested content.
This servlet produces TAR files as defined in POSIX.1-2001 standard and UTF-8 encoding for file names.
- Author:
- Thomas Scheffler (yagee)
- 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.tar.TarArchiveOutputStream
createContainer
(jakarta.servlet.ServletOutputStream sout, String comment) protected void
disposeContainer
(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream container) protected String
protected String
protected void
sendCompressedDirectory
(MCRPath file, BasicFileAttributes attrs, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream container) protected void
sendCompressedFile
(MCRPath file, BasicFileAttributes attrs, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream container) protected void
sendMetadataCompressed
(String fileName, byte[] content, long lastModified, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream 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
-
MCRTarServlet
public MCRTarServlet()
-
-
Method Details
-
sendCompressedDirectory
protected void sendCompressedDirectory(MCRPath file, BasicFileAttributes attrs, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream container) throws IOException - Specified by:
sendCompressedDirectory
in classMCRCompressServlet<org.apache.commons.compress.archivers.tar.TarArchiveOutputStream>
- Throws:
IOException
-
sendCompressedFile
protected void sendCompressedFile(MCRPath file, BasicFileAttributes attrs, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream container) throws IOException - Specified by:
sendCompressedFile
in classMCRCompressServlet<org.apache.commons.compress.archivers.tar.TarArchiveOutputStream>
- Throws:
IOException
-
sendMetadataCompressed
protected void sendMetadataCompressed(String fileName, byte[] content, long lastModified, org.apache.commons.compress.archivers.tar.TarArchiveOutputStream container) throws IOException - Specified by:
sendMetadataCompressed
in classMCRCompressServlet<org.apache.commons.compress.archivers.tar.TarArchiveOutputStream>
- Throws:
IOException
-
getMimeType
- Specified by:
getMimeType
in classMCRCompressServlet<org.apache.commons.compress.archivers.tar.TarArchiveOutputStream>
-
getFileExtension
- Specified by:
getFileExtension
in classMCRCompressServlet<org.apache.commons.compress.archivers.tar.TarArchiveOutputStream>
-
createContainer
protected org.apache.commons.compress.archivers.tar.TarArchiveOutputStream createContainer(jakarta.servlet.ServletOutputStream sout, String comment) - Specified by:
createContainer
in classMCRCompressServlet<org.apache.commons.compress.archivers.tar.TarArchiveOutputStream>
-
disposeContainer
protected void disposeContainer(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream container) throws IOException - Specified by:
disposeContainer
in classMCRCompressServlet<org.apache.commons.compress.archivers.tar.TarArchiveOutputStream>
- Throws:
IOException
-