You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2011/10/22 10:00:44 UTC
svn commit: r1187668 -
/camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/util/StringHelper.java
Author: davsclaus
Date: Sat Oct 22 08:00:43 2011
New Revision: 1187668
URL: http://svn.apache.org/viewvc?rev=1187668&view=rev
Log:
CAMEL-4571: Fixed compiler error due backport, and more code needed in camel-core.
Modified:
camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/util/StringHelper.java
Modified: camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/util/StringHelper.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/util/StringHelper.java?rev=1187668&r1=1187667&r2=1187668&view=diff
==============================================================================
--- camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/util/StringHelper.java (original)
+++ camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/util/StringHelper.java Sat Oct 22 08:00:43 2011
@@ -76,4 +76,18 @@ public final class StringHelper {
return s;
}
+ public static String removeLeadingAndEndingQuotes(String s) {
+ if (ObjectHelper.isEmpty(s)) {
+ return s;
+ }
+
+ if (s.startsWith("'") && s.endsWith("'")) {
+ return s.substring(1, s.length() - 1);
+ }
+ if (s.startsWith("\"") && s.endsWith("\"")) {
+ return s.substring(1, s.length() - 1);
+ }
+ return s;
+ }
+
}