Class MalwareScannerHelper


  • public class MalwareScannerHelper
    extends Object
    Helper for malware scanning.
    Since:
    8.0.0
    Author:
    XIMA MEDIA GmbH, Dresden
    • Method Detail

      • registerMalwareScanner

        public static void registerMalwareScanner​(BiFunction<javax.servlet.http.HttpServletRequest,​List<org.apache.commons.fileupload.FileItem>,​List<org.apache.commons.lang3.tuple.Pair<org.apache.commons.fileupload.FileItem,​MalwareScanReport>>> fileItemMalwareScannerImpl)
        Registers the given malware scanner if none has been registered yet.
        Parameters:
        fileItemMalwareScannerImpl - to register.
      • scanFileItems

        public static List<org.apache.commons.lang3.tuple.Pair<org.apache.commons.fileupload.FileItem,​MalwareScanReport>> scanFileItems​(javax.servlet.http.HttpServletRequest request,
                                                                                                                                              List<org.apache.commons.fileupload.FileItem> fileItems)
        Scans all file items, with a malware scanner for the system or client scope determined from the given request.
        Parameters:
        request - (Multipart) request which contained the file items.
        fileItems - File items from the multipart request to scan.
        Returns:
        A scan report for each file item, together with the file item itself.