Error message has been moved in a constant
This commit is contained in:
parent
8d7e88ff72
commit
635825ebd9
|
@ -37,6 +37,9 @@ public class Profile extends BaseREST implements org.gcube.gcat.api.interfaces.P
|
||||||
public static final String PROFILE_NAME_PARAMETER = "PROFILE_NAME";
|
public static final String PROFILE_NAME_PARAMETER = "PROFILE_NAME";
|
||||||
public static final String PROFILE_VALIDATION_ERROR;
|
public static final String PROFILE_VALIDATION_ERROR;
|
||||||
|
|
||||||
|
public static final String CANNOT_MANAGE_PROFILE_SCHEMA = "You cannot manage the profile schema";
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
StringBuilder validationError = new StringBuilder();
|
StringBuilder validationError = new StringBuilder();
|
||||||
validationError.append("The Profile is not valid because of the following error at validation time:\n%s\n\n");
|
validationError.append("The Profile is not valid because of the following error at validation time:\n%s\n\n");
|
||||||
|
@ -101,7 +104,7 @@ public class Profile extends BaseREST implements org.gcube.gcat.api.interfaces.P
|
||||||
setCalledMethod("PUT /" + PROFILES + "/{" + PROFILE_NAME_PARAMETER + "}");
|
setCalledMethod("PUT /" + PROFILES + "/{" + PROFILE_NAME_PARAMETER + "}");
|
||||||
try {
|
try {
|
||||||
if(name.compareToIgnoreCase(SCHEMA) == 0) {
|
if(name.compareToIgnoreCase(SCHEMA) == 0) {
|
||||||
throw new NotAllowedException("You cannot manage the profile schema", new Throwable("You cannot manage the profile schema"),
|
throw new NotAllowedException(CANNOT_MANAGE_PROFILE_SCHEMA, new Throwable(CANNOT_MANAGE_PROFILE_SCHEMA),
|
||||||
HttpMethod.GET.toString(), HttpMethod.HEAD.toString());
|
HttpMethod.GET.toString(), HttpMethod.HEAD.toString());
|
||||||
}
|
}
|
||||||
ISProfile isProfile = new ISProfile();
|
ISProfile isProfile = new ISProfile();
|
||||||
|
@ -131,7 +134,7 @@ public class Profile extends BaseREST implements org.gcube.gcat.api.interfaces.P
|
||||||
setCalledMethod("DELETE /" + PROFILES + "/{" + PROFILE_NAME_PARAMETER + "}");
|
setCalledMethod("DELETE /" + PROFILES + "/{" + PROFILE_NAME_PARAMETER + "}");
|
||||||
try {
|
try {
|
||||||
if(name.compareToIgnoreCase(SCHEMA) == 0) {
|
if(name.compareToIgnoreCase(SCHEMA) == 0) {
|
||||||
throw new NotAllowedException("You cannot manage the profile schema", new Throwable("You cannot manage the profile schema"),
|
throw new NotAllowedException(CANNOT_MANAGE_PROFILE_SCHEMA, new Throwable(CANNOT_MANAGE_PROFILE_SCHEMA),
|
||||||
HttpMethod.GET.toString(), HttpMethod.HEAD.toString());
|
HttpMethod.GET.toString(), HttpMethod.HEAD.toString());
|
||||||
}
|
}
|
||||||
ISProfile isProfile = new ISProfile();
|
ISProfile isProfile = new ISProfile();
|
||||||
|
|
Loading…
Reference in New Issue