From 5ea9e93c51b53e06de4176ff272b458b4c6e52b7 Mon Sep 17 00:00:00 2001 From: Tom Page Date: Tue, 7 Apr 2015 13:55:44 +0000 Subject: [PATCH] Minor changes to WebScriptUtils. I'm not sure which static import was being used previously, but since we had an explicit reference to lang3 I went with that. +review RM git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101243 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../source/java/org/alfresco/util/WebScriptUtils.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rm-server/source/java/org/alfresco/util/WebScriptUtils.java b/rm-server/source/java/org/alfresco/util/WebScriptUtils.java index 131687fe7a..11eda01d30 100644 --- a/rm-server/source/java/org/alfresco/util/WebScriptUtils.java +++ b/rm-server/source/java/org/alfresco/util/WebScriptUtils.java @@ -20,14 +20,12 @@ package org.alfresco.util; import static org.alfresco.util.ParameterCheck.mandatory; import static org.alfresco.util.ParameterCheck.mandatoryString; -import static org.apache.commons.lang.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isBlank; import java.io.IOException; import java.util.List; import java.util.Map; -import org.apache.commons.lang3.StringUtils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -139,7 +137,7 @@ public final class WebScriptUtils throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Could not get content from the request.", error); } - if (StringUtils.isBlank(content)) + if (isBlank(content)) { throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Content does not exist."); } @@ -172,7 +170,7 @@ public final class WebScriptUtils if (!jsonObject.has(paramName)) { - throw new WebScriptException(Status.STATUS_BAD_REQUEST, "The json object does not contain en entry with parameter '" + paramName + "'."); + throw new WebScriptException(Status.STATUS_BAD_REQUEST, "The json object does not contain an entry with parameter '" + paramName + "'."); } } @@ -234,7 +232,7 @@ public final class WebScriptUtils value = jsonObject.getString(key); if (checkValue && isBlank(value)) { - throw new WebScriptException(Status.STATUS_BAD_REQUEST, "The vale is missing for the key '" + key + "'."); + throw new WebScriptException(Status.STATUS_BAD_REQUEST, "The value is missing for the key '" + key + "'."); } } catch (JSONException error)