Package de.xima.fc.form.common.upload
Class XUploadContentTransformer
- java.lang.Object
-
- de.xima.fc.form.common.upload.XUploadContentTransformer
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IUploadPostProcessor
createImagePostProcessor(Integer targetWidth, Integer targetHeight, String targetImageFormat, Double targetQuality, Path tempDir)
static boolean
isImage(IXUpload upload)
static IXUpload
transformXUpload(IXUpload upload, List<IUploadPostProcessor> postProcessors, List<String> protocol)
Transforms the content of the given upload.
-
-
-
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 isnull
- a new
IXUpload
instance with the new content if the postprocessing chain was executed successfully
- Throws:
IOException
-
isImage
public static boolean isImage(IXUpload upload)
-
-