Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
Unable to read json from file
paul a carron
Ranch Hand
Posts: 37
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'm trying to read Json from a file(json.json). It's in my projcet in a folder called JsonRead. I've used the following code to read it but am getting nothing.
String jsonFileName = "/JsonRead/json.json"; System.out.println("jsonFileName: " + jsonFileName); JacksonTest jsonParserExample = new JacksonTest(); List<Vaults> vaults = jsonParserExample.buildVaultList(jsonFileName); System.out.println("vaults: " + vaults); System.out.println(vaults.toString());
The
System.out.println("vaults: " + vaults);
returns [].
Am I referencing it incorrectly?
Jesper de Jong
Java Cowboy
Posts: 16084
88
I like...
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What exactly does the json file contain and can you show the code of the method
JacksonTest.buildVaultList()
?
Jesper's Blog
-
Pluralsight Author Page
paul a carron
Ranch Hand
Posts: 37
posted 6 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Never mind. I was pointing to the wrong folder location.
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how to read JSON files using Gson
Code generates invalid Json
How can i get details a location in android?
Parsing a string with SimpleDateFormatter always give January as month
Use DAO stub for unit testing
More...