Class PathLengthConstraint

    • Method Detail

      • maxChars

        public static PathLengthConstraint maxChars​(int maxLength)
        Creates a new constraint that limits the number of characters in a path
        Parameters:
        maxLength - maximum number of characters
        Returns:
        constraint
      • maxBytes

        public static PathLengthConstraint maxBytes​(int maxLength)
        Creates a new constraint that limits the number of bytes in a path
        Parameters:
        maxLength - maximum number of bytes
        Returns:
        constraint
      • apply

        public void apply​(String path)
        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