Class XUploadContentTransformer

java.lang.Object
de.xima.fc.form.common.upload.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 Details

    • transformXUpload

      public static IXUpload transformXUpload(IXUpload upload, List<IUploadPostProcessor> postProcessors) 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
    • createImagePostProcessor

      public static IUploadPostProcessor createImagePostProcessor(Integer targetWidth, Integer targetHeight, String targetImgFormat, Double targetQuality, Path tmpDir, Consumer<String> protocolHandler)