in clearcase-server/src/jetbrains/buildServer/buildTriggers/vcs/clearcase/ClearCaseValidation.java [277:315]
public boolean validate(Map<String, String> properties, Collection<InvalidProperty> validationResultBuffer) {
//check path exists
final String ccViewRelativePath = trim(properties.get(Constants.RELATIVE_PATH));
if (isEmpty(ccViewRelativePath)) {
validationResultBuffer.add(new InvalidProperty(Constants.RELATIVE_PATH, Messages.getString("ClearCaseValidation.clearcase_view_relative_path_missed"))); //$NON-NLS-1$
debug(String.format(SINGLE_PARAM_VALIDATION_FAILED, ccViewRelativePath));
return false;
}
assert ccViewRelativePath != null;
if (ReferencesResolverUtil.containsReference(ccViewRelativePath)) return true;
//check paths is well formed
try {
final String normalizedPath = CCPathElement.normalizePath(ccViewRelativePath);
if (isEmpty(normalizedPath)) {
validationResultBuffer.add(new InvalidProperty(Constants.RELATIVE_PATH, Messages.getString("ClearCaseValidation.clearcase_view_relative_path_does_not_point_to_inner_folder"))); //$NON-NLS-1$
}
} catch (VcsException e) {
if (!mayContainReference(ccViewRelativePath)) {
validationResultBuffer.add(new InvalidProperty(Constants.RELATIVE_PATH, e.getMessage()));
debug(String.format(SINGLE_PARAM_VALIDATION_FAILED, ccViewRelativePath));
return false;
}
}
//check path is directory?
final int countBefore = validationResultBuffer.size();
String viewPath = trim(properties.get(Constants.CC_VIEW_PATH));
if (viewPath == null || ReferencesResolverUtil.containsReference(viewPath)) return true;
final String pathWithinTheView = new File(viewPath, ccViewRelativePath).getAbsolutePath();
checkDirectoryProperty(Constants.RELATIVE_PATH, pathWithinTheView, validationResultBuffer);
if (countBefore != validationResultBuffer.size()) {
debug(String.format(SINGLE_PARAM_VALIDATION_FAILED, ccViewRelativePath));
return false;
}
debug(String.format(SINGLE_PARAM_VALIDATION_PASSED, ccViewRelativePath));
return true;
}