public static String get ( URI metadataService , String path ) { checkNotNull ( metadataService , "metadataService" ) ; checkArgument ( metadataService . getPath ( ) . endsWith ( "/" ) , "metadataService must end with '/'; %s provided" , metadataService ) ; checkNotNull ( path , "path" ) ; InputStream stream = null ; try { stream = openStream ( metadataService + path ) ; String content = slurp ( new InputStreamReader ( stream ) ) ; if ( content . isEmpty ( ) ) { return null ; } return content ; } catch ( IOException e ) { return null ; } finally { try { if ( stream != null ) { stream . close ( ) ; } } catch ( IOException e ) { } } }
Retrieves content at a path if present .