Class DownloadManager


  • public class DownloadManager
    extends Object
    Manager for handling downloads of public form resources. Responds to HTTP requests for public resources by writing the content of the requested resource to the response.
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • DownloadManager

        public DownloadManager()
    • Method Detail

      • handleAttachment

        @Deprecated(forRemoval=true,
                    since="8.3.0")
        public static void handleAttachment​(javax.servlet.http.HttpServletRequest req,
                                            javax.servlet.http.HttpServletResponse resp,
                                            XfcSession xfs,
                                            UserContext uc)
                                     throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Handles the given request by writing content of the attachment to the response (if it exists).
        Parameters:
        req - The HTTP request to handle.
        resp - The HTTP response to write the attachment to.
        xfs - The session to use for the request.
        uc - The user context to use for the request.
        Throws:
        IOException - If an error occurs while writing the attachment to the response.
      • handleProjektRessource

        @Deprecated(forRemoval=true,
                    since="8.3.0")
        public static void handleProjektRessource​(javax.servlet.http.HttpServletRequest req,
                                                  javax.servlet.http.HttpServletResponse resp,
                                                  XfcSession xfs,
                                                  UserContext uc)
                                           throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Handles the given request by writing the content of the public project resource to the response (if it exists).
        Parameters:
        req - The HTTP request to handle.
        resp - The HTTP response to write the resource to.
        xfs - The session to use for the request.
        uc - The user context to use for the request.
        Throws:
        IOException - If an error occurs while writing the resource to the response.
      • handlePublicMandantRessourceByName

        @Deprecated(forRemoval=true,
                    since="8.3.0")
        public static boolean handlePublicMandantRessourceByName​(javax.servlet.http.HttpServletRequest req,
                                                                 javax.servlet.http.HttpServletResponse resp,
                                                                 UserContext uc)
                                                          throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Handles the given request by writing the content of the public client resource to the response (if it exists).
        Parameters:
        req - The HTTP request to handle.
        resp - The HTTP response to write the resource to.
        uc - The user context to use for the request.
        Returns:
        true if the resource was found and written to the response, false otherwise.
        Throws:
        IOException - If an error occurs while writing the resource to the response.
      • handlePublicMandantRessourceByName

        @Deprecated(forRemoval=true,
                    since="8.3.0")
        public static boolean handlePublicMandantRessourceByName​(javax.servlet.http.HttpServletRequest req,
                                                                 javax.servlet.http.HttpServletResponse resp,
                                                                 UserContext uc,
                                                                 String contentType)
                                                          throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Handles the given request by writing the content of the public client resource to the response (if it exists).
        Parameters:
        req - The HTTP request to handle.
        resp - The HTTP response to write the resource to.
        uc - The user context to use for the request.
        contentType - The content type of the resource.
        Returns:
        true if the resource was found and written to the response, false otherwise.
        Throws:
        IOException - If an error occurs while writing the resource to the response.
      • handlePublicPluginRessourceByName

        @Deprecated(forRemoval=true,
                    since="8.3.0")
        public static boolean handlePublicPluginRessourceByName​(javax.servlet.http.HttpServletRequest req,
                                                                javax.servlet.http.HttpServletResponse resp,
                                                                UserContext uc,
                                                                String contentType)
                                                         throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Handles the given request by writing the content of the public form resource plugin to the response (if it exists).
        Parameters:
        req - The HTTP request to handle.
        resp - The HTTP response to write the resource to.
        uc - The user context to use for the request.
        contentType - The content type of the resource.
        Returns:
        true if the resource was found and written to the response, false otherwise.
        Throws:
        IOException - If an error occurs while writing the resource to the response.
      • handlePublicPluginRessourceByUUID

        @Deprecated(forRemoval=true,
                    since="8.3.0")
        public static boolean handlePublicPluginRessourceByUUID​(javax.servlet.http.HttpServletRequest req,
                                                                javax.servlet.http.HttpServletResponse resp,
                                                                UserContext uc,
                                                                String contentType)
                                                         throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Handles the given request by writing the content of the public form resource plugin to the response (if it exists).
        Parameters:
        req - The HTTP request to handle.
        resp - The HTTP response to write the resource to.
        uc - The user context to use for the request.
        contentType - The content type of the resource.
        Returns:
        true if the resource was found and written to the response, false otherwise.
        Throws:
        IOException - If an error occurs while writing the resource to the response.
      • handlePublicProjektRessourceByName

        @Deprecated(forRemoval=true,
                    since="8.3.0")
        public static boolean handlePublicProjektRessourceByName​(javax.servlet.http.HttpServletRequest req,
                                                                 javax.servlet.http.HttpServletResponse resp,
                                                                 UserContext uc)
                                                          throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Handles the given request by writing the content of the public project resource to the response (if it exists).
        Parameters:
        req - The HTTP request to handle.
        resp - The HTTP response to write the resource to.
        uc - The user context to use for the request.
        Returns:
        true if the resource was found and written to the response, false otherwise.
        Throws:
        IOException - If an error occurs while writing the resource to the response.
      • handlePublicProjektRessourceByName

        @Deprecated(forRemoval=true,
                    since="8.3.0")
        public static boolean handlePublicProjektRessourceByName​(javax.servlet.http.HttpServletRequest req,
                                                                 javax.servlet.http.HttpServletResponse resp,
                                                                 UserContext uc,
                                                                 String contentType)
                                                          throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Handles the given request by writing the content of the public project resource to the response (if it exists).
        Parameters:
        req - The HTTP request to handle.
        resp - The HTTP response to write the resource to.
        uc - The user context to use for the request.
        contentType - The content type of the resource.
        Returns:
        true if the resource was found and written to the response, false otherwise.
        Throws:
        IOException - If an error occurs while writing the resource to the response.
      • handlePublicResourceRequest

        public static void handlePublicResourceRequest​(javax.servlet.http.HttpServletRequest req,
                                                       javax.servlet.http.HttpServletResponse resp,
                                                       UserContext uc)
        Handles the given request by writing the content of the requested to the response (if it exists). This method determines the resource from the parameters of the request.
        Parameters:
        req - The HTTP request to handle.
        resp - The HTTP response to write the resource to.
        uc - The user context to use for the request.
        Since:
        8.3.0
      • handlePublicRessourceByName

        @Deprecated(forRemoval=true,
                    since="8.3.0")
        public static void handlePublicRessourceByName​(javax.servlet.http.HttpServletRequest req,
                                                       javax.servlet.http.HttpServletResponse resp,
                                                       UserContext uc,
                                                       String contentType)
                                                throws IOException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Handles the given request by writing the content of the requested to the response (if it exists). This method determines the resource from the parameters of the request.
        Parameters:
        req - The HTTP request to handle.
        resp - The HTTP response to write the resource to.
        uc - The user context to use for the request.
        contentType - The content type of the resource.
        Throws:
        IOException - If an error occurs while writing the resource to the response.
      • isPublic

        public static boolean isPublic​(String resourceName)
        Checks whether the resource with the given file name can be accessed publicly. If this returns false, the resource cannot be accessed and no URLs should be generated for it.
        Parameters:
        resourceName - The name of the resource to check.
        Returns:
        true if the resource can be accessed publicly, false otherwise.