Skip to content

Commit d6278c8

Browse files
committed
Sort static methods.
1 parent 67e7c55 commit d6278c8

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

src/main/java/org/apache/commons/csv/CSVParser.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,32 @@
134134
*/
135135
public final class CSVParser implements Iterable<CSVRecord>, Closeable {
136136

137+
/**
138+
* Creates a parser for the given {@link File}.
139+
*
140+
* <p><strong>Note:</strong> This method internally creates a FileReader using
141+
* {@link java.io.FileReader#FileReader(java.io.File)} which in turn relies on the default encoding of the JVM that
142+
* is executing the code. If this is insufficient create a URL to the file and use
143+
* {@link #parse(URL, Charset, CSVFormat)}</p>
144+
*
145+
* @param file
146+
* a CSV file. Must not be null.
147+
* @param charset
148+
* A charset
149+
* @param format
150+
* the CSVFormat used for CSV parsing. Must not be null.
151+
* @return a new parser
152+
* @throws IllegalArgumentException
153+
* If the parameters of the format are inconsistent or if either file or format are null.
154+
* @throws IOException
155+
* If an I/O error occurs
156+
*/
157+
public static CSVParser parse(final File file, final Charset charset, final CSVFormat format) throws IOException {
158+
Assertions.notNull(file, "file");
159+
Assertions.notNull(format, "format");
160+
return new CSVParser(new InputStreamReader(new FileInputStream(file), charset), format);
161+
}
162+
137163
/**
138164
* Creates a CSV parser using the given {@link CSVFormat}.
139165
*
@@ -190,32 +216,6 @@ public static CSVParser parse(Reader reader, final CSVFormat format) throws IOEx
190216
return new CSVParser(reader, format);
191217
}
192218

193-
/**
194-
* Creates a parser for the given {@link File}.
195-
*
196-
* <p><strong>Note:</strong> This method internally creates a FileReader using
197-
* {@link java.io.FileReader#FileReader(java.io.File)} which in turn relies on the default encoding of the JVM that
198-
* is executing the code. If this is insufficient create a URL to the file and use
199-
* {@link #parse(URL, Charset, CSVFormat)}</p>
200-
*
201-
* @param file
202-
* a CSV file. Must not be null.
203-
* @param charset
204-
* A charset
205-
* @param format
206-
* the CSVFormat used for CSV parsing. Must not be null.
207-
* @return a new parser
208-
* @throws IllegalArgumentException
209-
* If the parameters of the format are inconsistent or if either file or format are null.
210-
* @throws IOException
211-
* If an I/O error occurs
212-
*/
213-
public static CSVParser parse(final File file, final Charset charset, final CSVFormat format) throws IOException {
214-
Assertions.notNull(file, "file");
215-
Assertions.notNull(format, "format");
216-
return new CSVParser(new InputStreamReader(new FileInputStream(file), charset), format);
217-
}
218-
219219
/**
220220
* Creates a parser for the given {@link String}.
221221
*

0 commit comments

Comments
 (0)