Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 20923 invoked from network); 13 Nov 2008 23:58:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Nov 2008 23:58:53 -0000 Received: (qmail 40528 invoked by uid 500); 13 Nov 2008 23:58:59 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 40479 invoked by uid 500); 13 Nov 2008 23:58:59 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 40470 invoked by uid 99); 13 Nov 2008 23:58:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Nov 2008 15:58:59 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Nov 2008 23:57:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 57729238898E; Thu, 13 Nov 2008 15:58:31 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@commons.apache.org From: sgoeschl@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081113235831.57729238898E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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