Class XUploadContentTransformer


  • public final class XUploadContentTransformer
    extends Object
    Helper for transforming the content of an XUpload. For example, the form designer offers users an option where they can specify that images should be compressed on the server before being stored.
    Since:
    8.2.0
    • Method Detail

      • transformXUpload

        public static IXUpload transformXUpload​(IXUpload upload,
                                                List<IUploadPostProcessor> postProcessors,
                                                List<String> protocol)
                                         throws IOException
        Transforms the content of the given upload. For example, the form designer offers users an option where they can specify that images should be compressed on the server before being stored.
        Parameters:
        upload - The content to transform.
        postProcessors - the chain of postprocessors to be applied (in the given order)
        Returns:
        The transformed content, which is
        • identical to the passed one if no postprocessing has been applied
        • null if the passed upload itself or one of the postprocessing results is null
        • a new IXUpload instance with the new content if the postprocessing chain was executed successfully
        Throws:
        IOException
      • isImage

        public static boolean isImage​(IXUpload upload)