csv reader can read file, stringify (not real save) and read the save itself wrote

This commit is contained in:
Minjae Song
2019-01-02 22:23:48 +09:00
parent 686e521a7a
commit aab258b0c8
4 changed files with 75 additions and 55 deletions

View File

@@ -53,9 +53,10 @@ object CSVFetcher {
@Throws(java.io.IOException::class)
fun readCSVasString(path: String): String {
net.torvald.terrarum.utils.CSVFetcher.csvString = StringBuffer()
java.nio.file.Files.lines(java.nio.file.FileSystems.getDefault().getPath(path)).forEach(
{ s -> net.torvald.terrarum.utils.CSVFetcher.csvString!!.append("$s\n") }
)
java.nio.file.Files.lines(java.nio.file.FileSystems.getDefault().getPath(path)).forEach {
s -> net.torvald.terrarum.utils.CSVFetcher.csvString!!.append("$s\n")
}
return net.torvald.terrarum.utils.CSVFetcher.csvString!!.toString()
}
}