I have a Java application using Guice and JavaFX that requires configurable resources.
I am trying to load multiple resources using https://github.com/dueni/faces-ext/blob/master/resourcebundle/src/main/java/ch/dueni/util/MultiplePropertiesResourceBundle.java
I am able to load the two resource files from the JAR, but I want to be able to load them from a local directory where a user has access to modify them.
I have tried sending them to AppData, but I would prefer the file to be somewhere more configurable like the installation folder. I also do not know if its possible to load properties files from outside of the package.
This is currently how to loads the resources using ClassLoader:
ClassLoader cl = Thread.currentThread().getContextClassLoader();
List<String> bundleNames = new ArrayList<String>();
try {
String baseFileName = baseName + ".properties";
String resourcePath = getResourcePath();
String resourceName = resourcePath + baseFileName;
if (isLoggable) {
LOG.logp(Level.FINE, CLASS, METHOD, "Looking for files named '" + resourceName + "'");
}
Enumeration<URL> names = cl.getResources(resourceName);
I want to be able to get the names by a custom function which searches a designated directory for resource files.
Is there anyway this is possible?