Closed treemanfm closed 7 years ago
Today, you have to set the property or env variable identifying the specific configuration file to use. (symphony.config.file or SYMPHONY_CONFIG_FILE)
Assume you want to have a default configuration file (eg. sjc.properties) which is automatically searched through CLASSPATH?
I can look at putting that into the next release, but for now you can hack it by:
Refrence this: https://stackoverflow.com/questions/1464291/how-to-really-read-text-file-from-classpath-in-java
Set the property: symphony.client.config=sjc.properties
Copy the file on the classpath to local file, using something like this..
public class CopyConfig
{
public static void main(String[] args)
{
InputStream stream = this.class.getResourceAsStream("/sjc.propertiest");
//OR
stream = this.class.getClassLoader().getResourceAsStream("sjc.properties");
File config = new File("sjc.properties");
Files.copy(stream, config.getPath());
SyphonyClientConfig symphonyClientConfig = new SymphonyClientConfig(true);
......
}
}
Does this help?
thanks @ftbb
public class SymphonyClientConfig { private static Logger log = LoggerFactory.getLogger(SymphonyClientConfig.class);