class urn_perun_facility_attribute_def_def_rtOutputFileName extends FacilityAttributesModuleAbstract implements FacilityAttributesModuleImplApi {

	@Override
	public void checkAttributeSyntax(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws WrongAttributeValueException {

		//attribute can be empty
		if (attribute.getValue() == null) {
			return;
		}

		String value = attribute.valueAsString();

		Matcher matcher = fileNamePattern.matcher(value);
		if (!matcher.matches()) {
			throw new WrongAttributeValueException(attribute, facility, "Name of the file can contain only alphabet, numeric, dash and underscore characters.");
		}
	}

}