File tree Expand file tree Collapse file tree 4 files changed +18
-1
lines changed
Samples/JavaDependencySampleApp Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ let package = Package(
8686 . product( name: " JavaKit " , package : " swift-java " ) ,
8787 . product( name: " JavaKitFunction " , package : " swift-java " ) ,
8888 . product( name: " JavaKitCollection " , package : " swift-java " ) ,
89+ . product( name: " JavaKitIO " , package : " swift-java " ) ,
90+ . product( name: " JavaKitNetwork " , package : " swift-java " ) ,
8991 ] ,
9092 exclude: [ " swift-java.config " ] ,
9193 swiftSettings: [
@@ -98,5 +100,7 @@ let package = Package(
98100 ]
99101 ) ,
100102
103+ . target( name: " JavaExample " ) ,
104+
101105 ]
102106)
Original file line number Diff line number Diff line change 11{
22 "classes" : {
33 "org.apache.commons.io.FilenameUtils" : "FilenameUtils",
4- "org.apache.commons.io.IOCase" : "IOCase"
4+ "org.apache.commons.io.IOCase" : "IOCase",
5+ "org.apache.commons.csv.CSVFormat" : "CSVFormat",
6+ "org.apache.commons.csv.CSVParser" : "CSVParser",
7+ "org.apache.commons.csv.CSVRecord" : "CSVRecord"
58 },
69 "dependencies" : [
710 "org.apache.commons:commons-csv:1.12.0"
Original file line number Diff line number Diff line change 1414
1515import JavaKit
1616import JavaKitFunction
17+ import JavaKitIO
1718import JavaKitConfigurationShared
1819import Foundation
1920
@@ -42,4 +43,13 @@ let ext = try! FilenameUtilsClass.getExtension(path)
4243print ( " org.apache.commons.io.FilenameUtils.getExtension = \( ext) " )
4344precondition ( ext == " exe " )
4445
46+ let CSCFormatClass = try JavaClass < CSVFormat > ( )
47+
48+ let reader = StringReader ( " hello,example " )
49+ for record in try CSCFormatClass . RFC4180. parse ( reader) !. getRecords ( ) ! {
50+ for field in record. toList ( ) ! {
51+ print ( " Field: \( field) " )
52+ }
53+ }
54+
4555print ( " Done. " )
You can’t perform that action at this time.
0 commit comments