public static final Properties read ( String classpath ) throws IOException { final URL url = Resources . getResource ( classpath ) ; final ByteSource byteSource = Resources . asByteSource ( url ) ; final Properties properties = new Properties ( ) ; InputStream inputStream = null ; try { inputStream = byteSource . openBufferedStream ( ) ; properties . load ( inputStream ) ; } catch ( final IOException ioException ) { ioException . printStackTrace ( ) ; } finally { if ( inputStream != null ) { try { inputStream . close ( ) ; } catch ( final IOException ioException ) { throw ioException ; } } } return properties ; }
read properties from classpath