Arkni/json-to-csv

simple.json is not found

Opened this issue · 1 comments

[INFO] [2016-11-09 08:41:22] JSONFlattener:130 - Handle the JSON String as JSON Array
[ERROR] [2016-11-09 08:41:22] JSONFlattener:107 - JsonFlattener#ParseJson(file, encoding) IOException:
java.io.FileNotFoundException: File 'files\simple.json' does not exist
at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1734)
at org.jsontocsv.parser.JSONFlattener.parseJson(JSONFlattener.java:104)
at org.jsontocsv.Main.main(Main.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Exception in thread "main" java.lang.NullPointerException
at org.jsontocsv.writer.CSVWriter.collectHeaders(CSVWriter.java:110)
at org.jsontocsv.writer.CSVWriter.getCSV(CSVWriter.java:58)
at org.jsontocsv.Main.main(Main.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

Arkni commented

Sorry for being late.

The example files can be found in files folder (which is part of this repo). Also, the main class is only provided as an example of running this lib (which might work if you convert this project to an Eclipse one, which used to be one I just didn't commit the Eclipse related config files).