Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java load config file

Properties prop = new Properties();
String fileName = "app.config";
try (FileInputStream fis = new FileInputStream(fileName)) {
    prop.load(fis);
} catch (FileNotFoundException ex) {
    ... // FileNotFoundException catch is optional and can be collapsed
} catch (IOException ex) {
    ...
}
System.out.println(prop.getProperty("app.name"));
System.out.println(prop.getProperty("app.version"));
Comment

java load config file

Properties prop = new Properties();
String fileName = "app.config";
try (FileInputStream fis = new FileInputStream(fileName)) {
    prop.load(fis);
} catch (FileNotFoundException ex) {
    ... // FileNotFoundException catch is optional and can be collapsed
} catch (IOException ex) {
    ...
}
System.out.println(prop.getProperty("app.name"));
System.out.println(prop.getProperty("app.version"));
Comment

java load config file

Properties prop = new Properties();
String fileName = "app.config";
try (FileInputStream fis = new FileInputStream(fileName)) {
    prop.load(fis);
} catch (FileNotFoundException ex) {
    ... // FileNotFoundException catch is optional and can be collapsed
} catch (IOException ex) {
    ...
}
System.out.println(prop.getProperty("app.name"));
System.out.println(prop.getProperty("app.version"));
Comment

java load config file

Properties prop = new Properties();
String fileName = "app.config";
try (FileInputStream fis = new FileInputStream(fileName)) {
    prop.load(fis);
} catch (FileNotFoundException ex) {
    ... // FileNotFoundException catch is optional and can be collapsed
} catch (IOException ex) {
    ...
}
System.out.println(prop.getProperty("app.name"));
System.out.println(prop.getProperty("app.version"));
Comment

java load config file

Properties prop = new Properties();
String fileName = "app.config";
try (FileInputStream fis = new FileInputStream(fileName)) {
    prop.load(fis);
} catch (FileNotFoundException ex) {
    ... // FileNotFoundException catch is optional and can be collapsed
} catch (IOException ex) {
    ...
}
System.out.println(prop.getProperty("app.name"));
System.out.println(prop.getProperty("app.version"));
Comment

java load config file

Properties prop = new Properties();
String fileName = "app.config";
try (FileInputStream fis = new FileInputStream(fileName)) {
    prop.load(fis);
} catch (FileNotFoundException ex) {
    ... // FileNotFoundException catch is optional and can be collapsed
} catch (IOException ex) {
    ...
}
System.out.println(prop.getProperty("app.name"));
System.out.println(prop.getProperty("app.version"));
Comment

PREVIOUS NEXT
Code Example
Java :: java minimize all windows 
Java :: run app by package android 
Java :: JAVA Printing Variables and Literals 
Java :: Java Creating WeakHashMap from Other Maps 
Java :: instance block 
Java :: Java Insert Elements to EnumSet 
Java :: Java throws clause 
Java :: Filter out any non-printable characters 
Java :: Array pocket in java 
Java :: add element to queue java 
Java :: before first in jdbc 
Java :: how to generate randome number in desired range java 
Java :: int to byte calculator 
Java :: subtract two variables in java 
Java :: maximum valid parentheses 
Java :: rstudio boxplot coloring 
Java :: java ordenar numeros ascendente 
Java :: rerun main method 
Java :: sartt timer of 40 second when send otp andrpid 
Java :: codegrepper java instanceof 
Java :: java matrix return a weird string 
Java :: set bean properties 
Java :: how to extract value from payload in java 
Java :: crazy error 
Java :: create object in java without new keyword 
Java :: java schleifendurchläufe zählen 
Java :: JAXRS EXCEPTION MAPPER 
Java :: Java Single element Annotations 
Java :: enhanced 4 loop 
Java :: xml definition file for spring 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =