Package org.mycore.common.content.util
Class MCRServletContentHelper
java.lang.Object
org.mycore.common.content.util.MCRServletContentHelper
- Author:
- Thomas Scheffler (yagee), Matthias Eichner
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildConfig
(jakarta.servlet.ServletConfig servletConfig) static long
copyLarge
(InputStream input, OutputStream output, long inputOffset, long length, byte[] buffer) static boolean
isServeContent
(jakarta.servlet.http.HttpServletRequest request) static void
serveContent
(MCRContent content, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletContext context) Serve the specified content, optionally including the data content.static void
serveContent
(MCRContent content, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletContext context, MCRServletContentHelper.Config config, boolean withContent) Serve the specified content, optionally including the data content.
-
Field Details
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE- See Also:
-
ATT_SERVE_CONTENT
-
-
Constructor Details
-
MCRServletContentHelper
public MCRServletContentHelper()
-
-
Method Details
-
buildConfig
public static MCRServletContentHelper.Config buildConfig(jakarta.servlet.ServletConfig servletConfig) -
isServeContent
public static boolean isServeContent(jakarta.servlet.http.HttpServletRequest request) -
serveContent
public static void serveContent(MCRContent content, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletContext context) throws IOException Serve the specified content, optionally including the data content. This method handles both GET and HEAD requests.- Throws:
IOException
-
serveContent
public static void serveContent(MCRContent content, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletContext context, MCRServletContentHelper.Config config, boolean withContent) throws IOException Serve the specified content, optionally including the data content. This method handles both GET and HEAD requests.- Throws:
IOException
-
copyLarge
public static long copyLarge(InputStream input, OutputStream output, long inputOffset, long length, byte[] buffer) throws IOException - Throws:
IOException
-