How to work with static files?

Hello guys,

I would like to add some files with static information to the project.
Let’s imagine that it will be a simple JSON file with some data. All I need is just to read data from this file.

  1. Where can I place these static files?
  2. How can I work with them? Can I use default readers? (like FileReader)

Thanks!

Hi,

There are no files in Java class path. There are resources: Accessing Resources
In order to load and read resources from JARs / ClassPath you can use Resources bean: Resources - CUBA Platform. Developer’s Manual