public final class JsonRuleBaseReader extends Object
HttpProxyRules in JSON format.| Modifier and Type | Method and Description |
|---|---|
static Map<String,HttpProxyRule> |
parseJson(InputStream in)
Will try to parse the
InputStream which is expected to be in the following
JSON format: |
public static Map<String,HttpProxyRule> parseJson(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–2015 Red Hat. All rights reserved.