public final class JsonRuleBaseReader
extends java.lang.Object
HttpProxyRules in JSON format.| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,HttpProxyRule> |
parseJson(java.io.InputStream in)
Will try to parse the
InputStream which is expected to be in the following
JSON format: |
public static java.util.Map<java.lang.String,HttpProxyRule> parseJson(java.io.InputStream in)
InputStream which is expected to be in the following
JSON format:
{ "rulebase" : [
{ "rule": "/foo/{path}", "to": "https://foo.com/cheese/{path}"},
{ "rule": "/customers/{id}/address/{addressId}", "to": "http://another.com/addresses/{addressId}/customer/{id}"}
]
}
Note that the passed-in InputStream will be closed by this method. This
is a little unusual as normally the closing is the responsibility of the party that created the
InputStream, but in this case we decided handling this is more user friendly.in - the InputStream stream to read.Map where the key maps to the 'rule' in the JSON, and the value maps to 'to'.Copyright © 2011-2014 Red Hat. All Rights Reserved.