commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject commons-csv git commit: Sort static methods.
Date Sat, 30 Jul 2016 18:02:58 GMT
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 <ggregory@apache.org>
Authored: Sat Jul 30 11:02:55 2016 -0700
Committer: Gary Gregory <ggregory@apache.org>
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<CSVRecord>, Closeable {
 
     /**
+     * Creates a parser for the given {@link File}.
+     *
+     * <p><strong>Note:</strong> 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)}</p>
+     *
+     * @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}.
      *
      * <p>
@@ -191,32 +217,6 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable
{
     }
 
     /**
-     * Creates a parser for the given {@link File}.
-     *
-     * <p><strong>Note:</strong> 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)}</p>
-     *
-     * @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


Mime
View raw message