File tree 8 files changed +18
-28
lines changed
core-java-io-conversions-2
main/java/com/baeldung/csv
8 files changed +18
-28
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,6 @@ This module contains articles about core Java input/output(IO) conversions.
6
6
- [ Java InputStream to String] ( https://www.baeldung.com/convert-input-stream-to-string )
7
7
- [ Java – Write an InputStream to a File] ( https://www.baeldung.com/convert-input-stream-to-a-file )
8
8
- [ Converting a BufferedReader to a JSONObject] ( https://www.baeldung.com/java-bufferedreader-to-jsonobject )
9
+ - [ Reading a CSV File into an Array] ( https://www.baeldung.com/java-csv-file-array )
10
+ - [ How to Write to a CSV File in Java] ( https://www.baeldung.com/java-csv )
9
11
- More articles: [[ <-- prev]] ( /core-java-modules/core-java-io-conversions )
Original file line number Diff line number Diff line change 26
26
<artifactId >json</artifactId >
27
27
<version >${json.version} </version >
28
28
</dependency >
29
+ <dependency >
30
+ <groupId >com.opencsv</groupId >
31
+ <artifactId >opencsv</artifactId >
32
+ <version >${opencsv.version} </version >
33
+ <scope >test</scope >
34
+ </dependency >
29
35
</dependencies >
30
36
31
37
<build >
40
46
41
47
<properties >
42
48
<json .version>20200518</json .version>
49
+ <opencsv .version>4.1</opencsv .version>
43
50
</properties >
44
51
45
52
</project >
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
package com .baeldung .csv ;
2
2
3
- import java .io .BufferedReader ;
4
- import java .io .File ;
5
- import java .io .FileNotFoundException ;
6
- import java .io .FileReader ;
7
- import java .io .IOException ;
8
- import java .util .ArrayList ;
9
- import java .util .Arrays ;
10
- import java .util .Collections ;
11
- import java .util .List ;
12
- import java .util .Scanner ;
13
-
3
+ import com .opencsv .CSVReader ;
14
4
import org .junit .Assert ;
15
5
import org .junit .Test ;
16
6
17
- import com .opencsv .CSVReader ;
7
+ import java .io .*;
8
+ import java .util .*;
18
9
19
10
public class ReadCSVInArrayUnitTest {
20
11
public static final String COMMA_DELIMITER = "," ;
Original file line number Diff line number Diff line change 1
1
package com .baeldung .csv ;
2
2
3
- import static org .junit .Assert .assertEquals ;
4
- import static org .junit .Assert .assertTrue ;
3
+ import org .junit .Before ;
4
+ import org .junit .Test ;
5
+ import org .slf4j .Logger ;
6
+ import org .slf4j .LoggerFactory ;
5
7
6
8
import java .io .File ;
7
9
import java .io .FileNotFoundException ;
10
12
import java .util .ArrayList ;
11
13
import java .util .List ;
12
14
13
- import org .junit .Before ;
14
- import org .junit .Test ;
15
- import org .slf4j .Logger ;
16
- import org .slf4j .LoggerFactory ;
15
+ import static org .junit .Assert .assertEquals ;
16
+ import static org .junit .Assert .assertTrue ;
17
17
18
18
public class WriteCsvFileExampleUnitTest {
19
19
private static final Logger LOG = LoggerFactory .getLogger (WriteCsvFileExampleUnitTest .class );
File renamed without changes.
Original file line number Diff line number Diff line change @@ -8,10 +8,8 @@ This module contains articles about core Java input and output (IO)
8
8
- [ Java – Directory Size] ( https://www.baeldung.com/java-folder-size )
9
9
- [ File Size in Java] ( https://www.baeldung.com/java-file-size )
10
10
- [ Zipping and Unzipping in Java] ( https://www.baeldung.com/java-compress-and-uncompress )
11
- - [ Reading a CSV File into an Array] ( https://www.baeldung.com/java-csv-file-array )
12
11
- [ How to Get the File Extension of a File in Java] ( https://www.baeldung.com/java-file-extension )
13
12
- [ Getting a File’s Mime Type in Java] ( https://www.baeldung.com/java-file-mime-type )
14
- - [ How to Write to a CSV File in Java] ( https://www.baeldung.com/java-csv )
15
13
- [ How to Avoid the Java FileNotFoundException When Loading Resources] ( https://www.baeldung.com/java-classpath-resource-cannot-be-opened )
16
14
- [ Create a Directory in Java] ( https://www.baeldung.com/java-create-directory )
17
15
- [[ More -->]] ( /core-java-modules/core-java-io-2 )
Original file line number Diff line number Diff line change 29
29
<version >${hsqldb.version} </version >
30
30
<scope >runtime</scope >
31
31
</dependency >
32
- <dependency >
33
- <groupId >com.opencsv</groupId >
34
- <artifactId >opencsv</artifactId >
35
- <version >${opencsv.version} </version >
36
- <scope >test</scope >
37
- </dependency >
38
32
<!-- Mime Type Resolution Libraries -->
39
33
<dependency >
40
34
<groupId >org.apache.tika</groupId >
142
136
</profiles >
143
137
144
138
<properties >
145
- <!-- util -->
146
- <opencsv .version>4.1</opencsv .version>
147
139
<!-- testing -->
148
140
<assertj .version>3.6.1</assertj .version>
149
141
<!-- maven plugins -->
You can’t perform that action at this time.
0 commit comments