class urn_perun_facility_attribute_def_def_scratchDirPermissions extends FacilityAttributesModuleAbstract implements FacilityAttributesModuleImplApi {

	@Override
	public void checkAttributeSyntax(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws WrongAttributeValueException {
		//Null is ok, it means use default permissions in script (probably 0700)
		if(attribute.getValue() == null) return;
		
		Matcher match = pattern.matcher(attribute.valueAsString());

		if(!match.matches()) throw new WrongAttributeValueException(attribute, facility, "Bad format of attribute, (expected something like '750' or '0700').");
	}

}