Class FileAndDirectoryNamingRule
java.lang.Object
gov.nasa.pds.tools.validate.rule.AbstractValidationRule
gov.nasa.pds.tools.validate.rule.pds4.FileAndDirectoryNamingRule
- All Implemented Interfaces:
ValidationRule,org.apache.commons.chain.Command
- Direct Known Subclasses:
FileAndDirectoryNamingChecker
public class FileAndDirectoryNamingRule extends AbstractValidationRule
Implements a validation rule enforcing file and directory
naming standards.
-
Field Summary
Fields Modifier and Type Field Description protected static intMAXIMUM_FILE_NAME_LENGTHprotected static PatternNAMING_PATTERNFields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE -
Constructor Summary
Constructors Constructor Description FileAndDirectoryNamingRule() -
Method Summary
Modifier and Type Method Description voidcheckFileAndDirectoryNaming()Checks that the files and directories in the target conform to the naming rules in sections 6C.1 and 6C.2.booleanisApplicable(String location)Tests whether a rule is applicable to a target location.protected booleanisDirectoryContainingInvalidCharacter(String filename, boolean isDirectory)protected booleanisFilenameContainingLegalCharacters(String filename)protected booleanisFilenameProhibited(String filename)protected booleanisFilenameTooLong(String filename)Methods inherited from class gov.nasa.pds.tools.validate.rule.AbstractValidationRule
execute, getCaption, getChildContext, getContext, getExtraTarget, getListener, getParentTarget, getRegistrar, getTarget, isDebugLogLevel, isInfoLogLevel, reportError, reportError, setCaption, verifyLidPrefix
-
Field Details
-
MAXIMUM_FILE_NAME_LENGTH
protected static final int MAXIMUM_FILE_NAME_LENGTH- See Also:
- Constant Field Values
-
NAMING_PATTERN
-
-
Constructor Details
-
FileAndDirectoryNamingRule
public FileAndDirectoryNamingRule()
-
-
Method Details
-
checkFileAndDirectoryNaming
Checks that the files and directories in the target conform to the naming rules in sections 6C.1 and 6C.2. -
isFilenameProhibited
-
isFilenameTooLong
-
isFilenameContainingLegalCharacters
-
isDirectoryContainingInvalidCharacter
-
isApplicable
Description copied from class:AbstractValidationRuleTests whether a rule is applicable to a target location.- Specified by:
isApplicablein interfaceValidationRule- Specified by:
isApplicablein classAbstractValidationRule- Parameters:
location- the target location- Returns:
- true, if the rule is applicable to the target, false otherwise
-