Class AbstractUidValidationTask
java.lang.Object
org.bonitasoft.plugin.validation.uid.AbstractUidValidationTask
- All Implemented Interfaces:
ValidationTask
- Direct Known Subclasses:
FragmentUidValidationTask,PageUidValidationTask,WidgetUidValidationTask
Abstract class used to check that UID artifacts located in a directory are valid.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.bonitasoft.web.designer.ArtifactBuilderArtifact builder required to check if a UID artifact is validprotected final PathDirectory where UID artifacts should be stored -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.bonitasoft.web.designer.model.ArtifactStatusReportgetArtifactStatus(String artifactId) protected abstract Stringprotected static booleanisUidArtifact(Path directory) Check if the given directory represents a UID artifact.voidvalidate()Execute the validation task.
-
Field Details
-
artifactBuilder
protected final org.bonitasoft.web.designer.ArtifactBuilder artifactBuilderArtifact builder required to check if a UID artifact is valid -
artifactsSourceDir
Directory where UID artifacts should be stored
-
-
Constructor Details
-
AbstractUidValidationTask
public AbstractUidValidationTask()
-
-
Method Details
-
validate
Description copied from interface:ValidationTaskExecute the validation task.- Specified by:
validatein interfaceValidationTask- Throws:
ValidationException- if validation criteria are not met
-
getTaskName
-
getArtifactStatus
protected abstract org.bonitasoft.web.designer.model.ArtifactStatusReport getArtifactStatus(String artifactId) -
getUidArtifacts
-
isUidArtifact
Check if the given directory represents a UID artifact.The directory is a UID artifact if its name does not match the regex
UID_DIRECTORY_EXCLUDE_REGEXand if it contains a json file matching exactly the directory name.For example the directory
fooBarmust contain the json filefooBar.jsonto be identified as a UID artifacts.- Parameters:
directory- path of the directory to check- Returns:
trueif the directory matches criteria described above- Throws:
ValidationErrorException- if an error occurred when parsing the given directory
-