camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1187668 - /camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/util/StringHelper.java
Date Sat, 22 Oct 2011 08:00:44 GMT
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;
+    }
+
 }



Mime
View raw message