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


Reply via email to