Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5057

How to create a relationship between specific pairs of a config.properties file in java?

$
0
0

I've multiple external JAR files, which include special proceedings for my application. The application itself just needs one proceeding at the time, depending on the proceeding name entered by the user.

With that beeing said, I've created a config.properties file, which contains relevant informations about each proceeding.

config.properties

PROC.1=NameOfProcIMPL.1=path.to.main.class.of.jarLIB.1=lib/somejar.jarPROC.2=NameOfProcIMPL.2=path.to.main.class.of.jarLIB.2=lib/somejar.jar...

I'm already able to read the config.properties file, but I can't create a relationship between the pairs, which belong together.

java code

try {    Properties prop = new Properties();    prop.load(new FileInputStream("path/to/config.properties"));    String proc = properties.getProperty("PROC.1");    String impl = properties.getProperty("IMPL.1");    String lib = properties.getProperty("LIB.1");} catch (Exception e) {}

I am now wondering how I can create a relationship between the pairs, so that I can recieve the IMPL.X value and LIB.X value by only having the PROC.X name.

Does anybody knows how I can achieve this? I highly appreciate any kind of help, sheers!


Viewing all articles
Browse latest Browse all 5057

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>