Class ContentDispositionHelper
java.lang.Object
de.xima.fc.user_portal.servlets.helper.ContentDispositionHelper
- Since:
- 8.4.0
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatHeaderValue(String type, String fileName, Charset charset) Formats the Content-Disposition header value based on the provided type, file name, and character set.static voidsetAttachmentHeader(javax.servlet.http.HttpServletResponse response, String type, String fileName, Charset charset) Sets the Content-Disposition header to indicate that the response should be treated as an attachment.
-
Constructor Details
-
ContentDispositionHelper
public ContentDispositionHelper()
-
-
Method Details
-
setAttachmentHeader
public static void setAttachmentHeader(javax.servlet.http.HttpServletResponse response, String type, String fileName, Charset charset) Sets the Content-Disposition header to indicate that the response should be treated as an attachment.- Parameters:
response- The HttpServletResponse object used to send the response.type- The type of the content disposition (e.g., "attachment").fileName- The name of the file to be used in the Content-Disposition header.charset- The character set to be used for encoding the file name.
-
formatHeaderValue
Formats the Content-Disposition header value based on the provided type, file name, and character set.- Parameters:
type- The type of the content disposition (e.g., "attachment").fileName- The name of the file to be used in the Content-Disposition header.charset- The character set to be used for encoding the file name.- Returns:
- The formatted Content-Disposition header value.
-