1 package com.github.mikkoi.maven.plugins.enforcer.rule.propertyusage; 2 3 import java.io.FileInputStream; 4 import java.io.IOException; 5 import java.io.InputStream; 6 import java.util.Properties; 7 8 @SuppressWarnings({"all"}) 9 public class App2 { 10 11 public String value1 = ""; 12 13 public Integer value2 = 0x0; 14 15 public double value3 = Double.valueOf("${also-prop.val}"); 16 17 public App2() { 18 Properties properties = new Properties(); 19 try (InputStream inputStream = new FileInputStream("app2.properties") ) { 20 properties.load(inputStream); 21 value1 = properties.getProperty("my-too.property.value"); 22 value2 = Integer.valueOf(properties.getProperty("other-too.prop.val")); 23 24 } catch (IOException e) { 25 System.out.print(e.getMessage()); 26 } 27 28 } 29 }