Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 505029BBC for ; Mon, 26 Mar 2012 18:32:15 +0000 (UTC) Received: (qmail 53051 invoked by uid 500); 26 Mar 2012 18:32:15 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 52997 invoked by uid 500); 26 Mar 2012 18:32: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 52990 invoked by uid 99); 26 Mar 2012 18:32:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Mar 2012 18:32:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Mon, 26 Mar 2012 18:32:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E8429238897A for ; Mon, 26 Mar 2012 18:31:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1305482 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java Date: Mon, 26 Mar 2012 18:31:53 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120326183153.E8429238897A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Mon Mar 26 18:31:53 2012 New Revision: 1305482 URL: http://svn.apache.org/viewvc?rev=1305482&view=rev Log: CSV-77 RFC 4180 (DEFAULT) format is wrong; should not ignore spaces or blank lines Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java?rev=1305482&r1=1305481&r2=1305482&view=diff ============================================================================== --- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java (original) +++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java Mon Mar 26 18:31:53 2012 @@ -57,17 +57,38 @@ public class CSVFormat implements Serial private static CSVFormat PRISTINE = new CSVFormat(DISABLED, DISABLED, DISABLED, DISABLED, false, false, false, null, null); - /** Standard comma separated format as defined by RFC 4180. */ + /** + * Standard comma separated format, as for {@link #RFC4180} but allowing blank lines. + *
    + *
  • withDelimiter(',')
  • + *
  • withEncapsulator('"')
  • + *
  • withEmptyLinesIgnored(true)
  • + *
  • withLineSeparator(CRLF)
  • + *
+ */ public static final CSVFormat DEFAULT = PRISTINE. withDelimiter(',') .withEncapsulator('"') - .withLeadingSpacesIgnored(true) - .withTrailingSpacesIgnored(true) .withEmptyLinesIgnored(true) .withLineSeparator(CRLF) ; + /** + * Comma separated format as defined by RFC 4180. + *
    + *
  • withDelimiter(',')
  • + *
  • withEncapsulator('"')
  • + *
  • withLineSeparator(CRLF)
  • + *
  • + *
+ */ + public static final CSVFormat RFC4180 = + PRISTINE. + withDelimiter(',') + .withEncapsulator('"') + .withLineSeparator(CRLF) + ; /** * Excel file format (using a comma as the value delimiter).