commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgoes...@apache.org
Subject svn commit: r713874 - /commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
Date Thu, 13 Nov 2008 23:58:31 GMT
Author: sgoeschl
Date: Thu Nov 13 15:58:31 2008
New Revision: 713874

URL: http://svn.apache.org/viewvc?rev=713874&view=rev
Log:
Providing a more correct toString() representation which does quoting

Modified:
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java?rev=713874&r1=713873&r2=713874&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
(original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
Thu Nov 13 15:58:31 2008
@@ -222,4 +222,21 @@
             return cleanedArgument;
         }
     }
+
+    /**
+     * Determines if this is a quoted argumented - either single or
+     * double quote.
+     *
+     * @param argument the argument to check
+     * @return true when the argument is quoted
+     */
+    public static boolean isQuoted(final String argument) {
+        if((argument.startsWith(SINGLE_QUOTE) || argument.startsWith(DOUBLE_QUOTE)) &&

+           (argument.startsWith(SINGLE_QUOTE) || argument.startsWith(DOUBLE_QUOTE))  ) {
+            return true;
+        }
+        else {
+            return false;
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message