Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 703BA200B56 for ; Sat, 30 Jul 2016 20:03:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6EADB160A8A; Sat, 30 Jul 2016 18:03:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BEC97160A63 for ; Sat, 30 Jul 2016 20:02:59 +0200 (CEST) Received: (qmail 5014 invoked by uid 500); 30 Jul 2016 18:02:58 -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 5005 invoked by uid 99); 30 Jul 2016 18:02:58 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jul 2016 18:02:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 888E3E1892; Sat, 30 Jul 2016 18:02:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ggregory@apache.org To: commits@commons.apache.org Message-Id: <0ad457710b9c4e67872e18185a17073b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: commons-csv git commit: Sort static methods. Date: Sat, 30 Jul 2016 18:02:58 +0000 (UTC) archived-at: Sat, 30 Jul 2016 18:03:00 -0000 Repository: commons-csv Updated Branches: refs/heads/master 67e7c5509 -> d6278c817 Sort static methods. Project: http://git-wip-us.apache.org/repos/asf/commons-csv/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-csv/commit/d6278c81 Tree: http://git-wip-us.apache.org/repos/asf/commons-csv/tree/d6278c81 Diff: http://git-wip-us.apache.org/repos/asf/commons-csv/diff/d6278c81 Branch: refs/heads/master Commit: d6278c817a1b0b89222bc58c12bbebf9a07ca82f Parents: 67e7c55 Author: Gary Gregory Authored: Sat Jul 30 11:02:55 2016 -0700 Committer: Gary Gregory Committed: Sat Jul 30 11:02:55 2016 -0700 ---------------------------------------------------------------------- .../java/org/apache/commons/csv/CSVParser.java | 52 ++++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-csv/blob/d6278c81/src/main/java/org/apache/commons/csv/CSVParser.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/csv/CSVParser.java b/src/main/java/org/apache/commons/csv/CSVParser.java index 9533a61..8550342 100644 --- a/src/main/java/org/apache/commons/csv/CSVParser.java +++ b/src/main/java/org/apache/commons/csv/CSVParser.java @@ -135,6 +135,32 @@ import java.util.TreeMap; public final class CSVParser implements Iterable, Closeable { /** + * Creates a parser for the given {@link File}. + * + *

Note: This method internally creates a FileReader using + * {@link java.io.FileReader#FileReader(java.io.File)} which in turn relies on the default encoding of the JVM that + * is executing the code. If this is insufficient create a URL to the file and use + * {@link #parse(URL, Charset, CSVFormat)}

+ * + * @param file + * a CSV file. Must not be null. + * @param charset + * A charset + * @param format + * the CSVFormat used for CSV parsing. Must not be null. + * @return a new parser + * @throws IllegalArgumentException + * If the parameters of the format are inconsistent or if either file or format are null. + * @throws IOException + * If an I/O error occurs + */ + public static CSVParser parse(final File file, final Charset charset, final CSVFormat format) throws IOException { + Assertions.notNull(file, "file"); + Assertions.notNull(format, "format"); + return new CSVParser(new InputStreamReader(new FileInputStream(file), charset), format); + } + + /** * Creates a CSV parser using the given {@link CSVFormat}. * *

@@ -191,32 +217,6 @@ public final class CSVParser implements Iterable, Closeable { } /** - * Creates a parser for the given {@link File}. - * - *

Note: This method internally creates a FileReader using - * {@link java.io.FileReader#FileReader(java.io.File)} which in turn relies on the default encoding of the JVM that - * is executing the code. If this is insufficient create a URL to the file and use - * {@link #parse(URL, Charset, CSVFormat)}

- * - * @param file - * a CSV file. Must not be null. - * @param charset - * A charset - * @param format - * the CSVFormat used for CSV parsing. Must not be null. - * @return a new parser - * @throws IllegalArgumentException - * If the parameters of the format are inconsistent or if either file or format are null. - * @throws IOException - * If an I/O error occurs - */ - public static CSVParser parse(final File file, final Charset charset, final CSVFormat format) throws IOException { - Assertions.notNull(file, "file"); - Assertions.notNull(format, "format"); - return new CSVParser(new InputStreamReader(new FileInputStream(file), charset), format); - } - - /** * Creates a parser for the given {@link String}. * * @param string