2

I'm trying to generate a class structure by parsing a json file which ends up in many anonymous nested classes. I then save the file in my project build folder and configure gradle to add its path as a source folder. However when I try to instantiate the class I get a FileNotFoundException which claims that File name too long and yeah, the specific path is 370 characters long so I guess it is too long when it tries to instantiate some of the nested classes.

I tried breaking it into smaller classes and save them in different packages but the problem is that many parts of the json file are named the same but have different content so it's hard to know which class to reference to. Keeping them nested makes life much easier.

So I wonder if there is any solution to using this huge class. Is there a way to allow for larger paths? Can I somehow read the class into memory instead of saving it to a file? Is there any other solution I could choose?

uzilan
  • 2,554
  • 2
  • 31
  • 46

0 Answers0