public static NetworkConfig fromJsonStream ( InputStream configStream ) throws InvalidArgumentException , NetworkConfigurationException { logger . trace ( "NetworkConfig.fromJsonStream..." ) ; // Sanity check if ( configStream == null ) { throw new InvalidArgumentException ( "configStream must be specified" ) ; } // Read the input stream and convert to JSON try ( JsonReader reader = Json . createReader ( configStream ) ) { JsonObject jsonConfig = ( JsonObject ) reader . read ( ) ; return fromJsonObject ( jsonConfig ) ; } }
Creates a new NetworkConfig instance configured with details supplied in JSON format