Class UriUtils


  • public class UriUtils
    extends java.lang.Object
    Uri related util functions
    • Constructor Summary

      Constructors 
      Constructor Description
      UriUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isUriAllowed​(java.lang.String uri, java.util.List<java.util.regex.Pattern> allowUriListPatterns, boolean allowWhenListAbsent, boolean allowWhenListEmpty)
      Validate uris against a allowUriListPatterns, list of patterns If empty list of patterns, default behaviour is deny.
      • Methods inherited from class java.lang.Object

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

      • UriUtils

        public UriUtils()
    • Method Detail

      • isUriAllowed

        public static boolean isUriAllowed​(java.lang.String uri,
                                           java.util.List<java.util.regex.Pattern> allowUriListPatterns,
                                           boolean allowWhenListAbsent,
                                           boolean allowWhenListEmpty)
        Validate uris against a allowUriListPatterns, list of patterns If empty list of patterns, default behaviour is deny. Please refer to @{CommonUtils.regexListToPatterns} to generate the list of patterns from list of strings, and cache them, to avoid recompilation every time.
        Parameters:
        uri - uri to be validated
        allowUriListPatterns - preprocessed pattens input
        allowWhenListAbsent - default behaviour expected when a null allowList has been passed in as an input
        allowWhenListEmpty - default behaviour expected when an empty allowList has been passed in as an input
        Returns: