Class LocationValidator


  • public class LocationValidator
    extends Object
    Implements a validator that validates a location (file or directory) against a validation rule set. If no rule set is specified, an appropriate default is chosen.
    • Method Detail

      • setReport

        public void setReport​(Report report)
      • getCheckInbetweenFields

        public boolean getCheckInbetweenFields()
      • setCheckInbetweenFields

        public void setCheckInbetweenFields​(boolean flag)
      • validate

        public void validate​(File f)
        Validates a location specified by a file or directory.
        Parameters:
        f - the file or directory to validate
      • validate

        public void validate​(URL target)
      • validate

        public void validate​(ValidateProblemHandler problemHandler,
                             URL url)
        Validates a URL location with a given problem handler. This must be a URL that can be resolved to a file location.
        Parameters:
        problemHandler - the problem handler
        url - the URL to validate
        Throws:
        URISyntaxException
      • setExtraTargetInContext

        public void setExtraTargetInContext​(ArrayList<URL> alternateReferentialPaths)
      • setTargetRegistrar

        public void setTargetRegistrar​(TargetRegistrar registrar)
        Sets the target registrar for the next validation.
        Parameters:
        registrar - the new target registrar
      • setTaskManager

        public void setTaskManager​(TaskManager manager)
        Sets the task manager to use for running the validation tasks.
        Parameters:
        manager - the new task manager
      • setSchema

        public void setSchema​(List<URL> schemaFiles)
      • setSchematrons

        public void setSchematrons​(List<String> schematrons)
      • setCatalogs

        public void setCatalogs​(List<String> catalogFiles)
      • setSchemaCheck

        public void setSchemaCheck​(boolean value,
                                   boolean useLabelSchema)
      • setSchematronCheck

        public void setSchematronCheck​(Boolean value,
                                       Boolean useLabelSchematron)
      • setLabelSchematrons

        public void setLabelSchematrons​(Map<String,​String> labelSchematrons)
      • setForce

        public void setForce​(boolean force)
      • setFileFilters

        public void setFileFilters​(List<String> regExps)
      • setRecurse

        public void setRecurse​(boolean traverse)
      • setChecksumManifest

        public void setChecksumManifest​(Map<URL,​String> checksums)
      • setCheckData

        public void setCheckData​(boolean flag)
      • getLabelValidator

        public LabelValidator getLabelValidator()
        Gets a singleton label validator.
        Returns:
        the label validator
      • setRule

        public void setRule​(String ruleName)
        Forces a validation rule to use for the target location.
        Parameters:
        ruleName - the name of the rule
      • setEveryN

        public void setEveryN​(int value)
      • setContextMismatchAsWarn

        public void setContextMismatchAsWarn​(boolean value)
      • setCompleteDescriptions

        public void setCompleteDescriptions​(boolean b)
      • setSpotCheckData

        public void setSpotCheckData​(int value)
      • setPDFErrorDir

        public void setPDFErrorDir​(String dir)
      • setAllowUnlabeledFiles

        public void setAllowUnlabeledFiles​(boolean flag)
      • setValidateContext

        public void setValidateContext​(boolean flag)
      • setSkipProductValidation

        public void setSkipProductValidation​(boolean flag)
      • setLabelExtension

        public void setLabelExtension​(String extension)
      • setLastDirectoryFlag

        public void setLastDirectoryFlag​(boolean flag)