public static Service read ( Bundle bundle ) { String resourcePath = DOCS_CLASSPATH_PREFIX + "/" + SERVICE_DOC_FILE ; URL bundleResource = bundle . getResource ( resourcePath ) ; if ( bundleResource == null ) { return null ; } try ( InputStream is = bundleResource . openStream ( ) ) { return new ServiceJson ( ) . read ( is ) ; } catch ( Throwable ex ) { log . error ( "Unable to parse JSON file " + resourcePath + " from bundle " + bundle . getSymbolicName ( ) ) ; return null ; } }
Reads service model from bundle classpath .