Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 35551 invoked from network); 8 Mar 2008 17:22:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Mar 2008 17:22:20 -0000 Received: (qmail 34378 invoked by uid 500); 8 Mar 2008 17:22:15 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 34337 invoked by uid 500); 8 Mar 2008 17:22:15 -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 34328 invoked by uid 99); 8 Mar 2008 17:22:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Mar 2008 09:22:15 -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.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Mar 2008 17:21:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4B41E1A983A; Sat, 8 Mar 2008 09:21:56 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r635022 - /commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java Date: Sat, 08 Mar 2008 17:21:56 -0000 To: commits@commons.apache.org From: rwinston@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080308172156.4B41E1A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rwinston Date: Sat Mar 8 09:21:55 2008 New Revision: 635022 URL: http://svn.apache.org/viewvc?rev=635022&view=rev Log: NET-198 Modified: commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java Modified: commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java?rev=635022&r1=635021&r2=635022&view=diff ============================================================================== --- commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java (original) +++ commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java Sat Mar 8 09:21:55 2008 @@ -63,17 +63,36 @@ * If the recentDateFormat member has been defined, try to parse the * supplied string with that. If that parse fails, or if the recentDateFormat * member has not been defined, attempt to parse with the defaultDateFormat - * member. If that fails, throw a ParseException. + * member. If that fails, throw a ParseException. * - * @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String) - */ - /* (non-Javadoc) + * This method allows a {@link Calendar} instance to be passed in which represents the + * current (system) time. * + * @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String) + * + * @param timestampStr The timestamp to be parsed */ public Calendar parseTimestamp(String timestampStr) throws ParseException { Calendar now = Calendar.getInstance(); now.setTimeZone(this.getServerTimeZone()); - + return parseTimestamp(timestampStr, now); + } + + /** + * Implements the one {@link FTPTimestampParser#parseTimestamp(String) method} + * in the {@link FTPTimestampParser FTPTimestampParser} interface + * according to this algorithm: + * + * If the recentDateFormat member has been defined, try to parse the + * supplied string with that. If that parse fails, or if the recentDateFormat + * member has not been defined, attempt to parse with the defaultDateFormat + * member. If that fails, throw a ParseException. + * + * @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String) + * @param timestampStr The timestamp to be parsed + * @param now The current time + */ + public Calendar parseTimestamp(String timestampStr, Calendar now) throws ParseException { Calendar working = Calendar.getInstance(); working.setTimeZone(getServerTimeZone()); ParsePosition pp = new ParsePosition(0);