*/
public Resource(String url) throws RestApiException {
// match URL
Matcher m = reResource.matcher(url);
if(! m.matches()) {
throw new RestApiException("Invalid URL pattern: " + url);
}
// method
if(m.group(1) != null) {
method = Method.valueOf(m.group(1).toUpperCase());
} else {
method = Method.HTTP;
}
// host
if(m.group(2) == null) {
throw new RestApiException("Invalid host definition");
}
host = m.group(2);
// port
if(m.group(3) != null) {