@Test(expected = IOException.class) public void testGetPropertyFromClassPathPropertyThatDoesntExist() throws Exception { assertNull(ClassSearchUtil.getPropertyFromClassPath("META-INF/jsystemCore.build.properties", "jversionxxx")); }
public static String getPropertyFromClassPath(String propertyFileResourcePath,String propertyName ) throws Exception { Properties p = new Properties(); InputStream inStream = null; try { inStream = ClassSearchUtil.class.getClassLoader().getResourceAsStream(propertyFileResourcePath); if (inStream == null){ throw new IOException("Property file not found in classpath. " + propertyFileResourcePath ); } p.load(inStream); } finally{ if (inStream != null){ inStream.close(); } } return p.getProperty(propertyName); }
ClassSearchUtil { public static String getPropertyFromClassPath(String propertyFileResourcePath,String propertyName ) throws Exception { Properties p = new Properties(); InputStream inStream = null; try { inStream = ClassSearchUtil.class.getClassLoader().getResourceAsStream(propertyFileResourcePath); if (inStream == null){ throw new IOException("Property file not found in classpath. " + propertyFileResourcePath ); } p.load(inStream); } finally{ if (inStream != null){ inStream.close(); } } return p.getProperty(propertyName); } }
ClassSearchUtil { public static String getPropertyFromClassPath(String propertyFileResourcePath,String propertyName ) throws Exception { Properties p = new Properties(); InputStream inStream = null; try { inStream = ClassSearchUtil.class.getClassLoader().getResourceAsStream(propertyFileResourcePath); if (inStream == null){ throw new IOException("Property file not found in classpath. " + propertyFileResourcePath ); } p.load(inStream); } finally{ if (inStream != null){ inStream.close(); } } return p.getProperty(propertyName); }  }
ClassSearchUtil { public static String getPropertyFromClassPath(String propertyFileResourcePath,String propertyName ) throws Exception { Properties p = new Properties(); InputStream inStream = null; try { inStream = ClassSearchUtil.class.getClassLoader().getResourceAsStream(propertyFileResourcePath); if (inStream == null){ throw new IOException("Property file not found in classpath. " + propertyFileResourcePath ); } p.load(inStream); } finally{ if (inStream != null){ inStream.close(); } } return p.getProperty(propertyName); }  static ArrayList<String> searchClasses(Class<?> ofType, String classPath, boolean filterAbstract, String[] ignoreList, String[] includeList); static String getPropertyFromClassPath(String propertyFileResourcePath,String propertyName ); }
ClassSearchUtil { public static String getPropertyFromClassPath(String propertyFileResourcePath,String propertyName ) throws Exception { Properties p = new Properties(); InputStream inStream = null; try { inStream = ClassSearchUtil.class.getClassLoader().getResourceAsStream(propertyFileResourcePath); if (inStream == null){ throw new IOException("Property file not found in classpath. " + propertyFileResourcePath ); } p.load(inStream); } finally{ if (inStream != null){ inStream.close(); } } return p.getProperty(propertyName); }  static ArrayList<String> searchClasses(Class<?> ofType, String classPath, boolean filterAbstract, String[] ignoreList, String[] includeList); static String getPropertyFromClassPath(String propertyFileResourcePath,String propertyName );  }