fix error message on invalid template name

This commit is contained in:
Shay Banon 2012-03-07 23:56:01 +02:00
parent 6b11b760ae
commit 76654f1d0d
1 changed files with 3 additions and 3 deletions

View File

@ -148,6 +148,9 @@ public class MetaDataIndexTemplateService extends AbstractComponent {
if (!request.name.toLowerCase().equals(request.name)) {
throw new InvalidIndexTemplateException(request.name, "name must be lower cased");
}
if (!request.name.toLowerCase().equals(request.name)) {
throw new InvalidIndexTemplateException(request.name, "name must be lower cased");
}
if (request.template.contains(" ")) {
throw new InvalidIndexTemplateException(request.name, "template must not contain a space");
}
@ -160,9 +163,6 @@ public class MetaDataIndexTemplateService extends AbstractComponent {
if (request.template.startsWith("_")) {
throw new InvalidIndexTemplateException(request.name, "template must not start with '_'");
}
if (!request.name.toLowerCase().equals(request.name)) {
throw new InvalidIndexTemplateException(request.name, "template must be lower cased");
}
if (!Strings.validFileNameExcludingAstrix(request.template)) {
throw new InvalidIndexTemplateException(request.name, "template must not container the following characters " + Strings.INVALID_FILENAME_CHARS);
}