Class SecuredUpload


  • public class SecuredUpload
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      SecuredUpload()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isValidFile​(java.lang.String fileToCheck, java.lang.String fileType, Delegator delegator)  
      static boolean isValidFileName​(java.lang.String fileToCheck, Delegator delegator)  
      static boolean isValidText​(java.lang.String content, java.util.List<java.lang.String> allowed)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SecuredUpload

        public SecuredUpload()
    • Method Detail

      • isValidText

        public static boolean isValidText​(java.lang.String content,
                                          java.util.List<java.lang.String> allowed)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • isValidFileName

        public static boolean isValidFileName​(java.lang.String fileToCheck,
                                              Delegator delegator)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • isValidFile

        public static boolean isValidFile​(java.lang.String fileToCheck,
                                          java.lang.String fileType,
                                          Delegator delegator)
                                   throws java.io.IOException,
                                          org.apache.commons.imaging.ImageReadException
        Parameters:
        fileToCheck -
        fileType -
        Returns:
        true if the file is valid
        Throws:
        java.io.IOException
        org.apache.commons.imaging.ImageReadException