I have a Java properties file that has lots of different properties in it for different things:
ui.datasource.st.name=MyTest
ui.datasource.st.port=111
ui.datasource.st.ip=1.1.1.1
ui.outputtype.snapshot=Snapshot
ui.outputtype.spreadsheet=Spreadsheet - xls
The file is a lot bigger than this.
I want to jump to the ui.outputtype section without looping through the file and checking the key value.
Is there a way to do this?
You should load the properties, and then you can get the value by its key:
Properties props = new Properties();
props.load(new FileInputStream("my.properties"));
props.getProperty("ui.outputtype.snapshot");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With