Class RegexPathConstraint

    • Constructor Detail

      • RegexPathConstraint

        public RegexPathConstraint​(boolean mustMatch,
                                   Pattern pattern)
    • Method Detail

      • mustNotContain

        public static RegexPathConstraint mustNotContain​(Pattern pattern)
        Creates a new constraint that validates paths do not match the regex
        Parameters:
        pattern - the regex that paths must not match
        Returns:
        constraint
      • mustContain

        public static RegexPathConstraint mustContain​(Pattern pattern)
        Creates a new constraint that validates paths do match the regex
        Parameters:
        pattern - the regex that paths must match
        Returns:
        constraint
      • apply

        public void apply​(String path)
        Description copied from interface: PathConstraint
        Validates that a path meets a defined constraint
        Specified by:
        apply in interface PathConstraint
        Parameters:
        path - the path to validate
      • apply

        public void apply​(String fileName,
                          String path)
        Validates that a filename meets a defined constraint
        Specified by:
        apply in interface FileNameConstraint
        Parameters:
        fileName - the filename to validate
        path - the path the filename is part of. This is supplied for context and is not validated