*/
class VerifyRelativeFilePath implements FormValidator {
@Override
public void validate(List<FormItem> items, FormValidation outcome) {
FormItem filePath = findItem(items, "filePath");
FormItem fileRelativeTo = findItem(items, "fileRelativeTo");
if (filePath != null && fileRelativeTo != null) {
if (isRelative(getValue(filePath)) && getValue(fileRelativeTo).length() == 0) {
outcome.addError(fileRelativeTo.getName());
fileRelativeTo.setErroneous(true);
} else {
fileRelativeTo.setErroneous(false);
}
}
}