public static String getProperty(String key){ InputStream in = PropertiesUtils.class.getResourceAsStream("/conf.properties"); Properties properties = new Properties(); String value; try { properties.load(in); value = properties.getProperty(key); in.close(); return value; } catch (IOException e) { e.printStackTrace(); } return null; }