This repository has been archived by the owner on Apr 30, 2023. It is now read-only.
/
AbstractBaseRestClient.java
58 lines (43 loc) · 1.89 KB
/
AbstractBaseRestClient.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.commsen.wedeploy.transport.rest;
import java.io.IOException;
import java.net.URI;
import java.util.Collections;
import java.util.Map;
public abstract class AbstractBaseRestClient implements WeDeployRestClient {
public AbstractBaseRestClient() {
super();
}
public WeDeployResponse get(final URI uri) throws IOException {
return call(uri, "GET", Collections.emptyMap(), null);
}
public WeDeployResponse get(final URI uri, final Map<String, String> headers) throws IOException {
return call(uri, "GET", headers, null);
}
public WeDeployResponse get(final URI uri, final Map<String, String> headers, final String body) throws IOException {
return call(uri, "GET", headers, body);
}
public WeDeployResponse post(final URI uri, final String body) throws IOException {
return call(uri, "POST", Collections.emptyMap(), body);
}
public WeDeployResponse post(final URI uri, final Map<String, String> headers, final String body) throws IOException {
return call(uri, "POST", headers, body);
}
public WeDeployResponse put(final URI uri, final String body) throws IOException {
return call(uri, "PUT", Collections.emptyMap(), body);
}
public WeDeployResponse put(final URI uri, final Map<String, String> headers, final String body) throws IOException {
return call(uri, "PUT", headers, body);
}
public WeDeployResponse delete(final URI uri) throws IOException {
return call(uri, "DELETE", Collections.emptyMap(), null);
}
public WeDeployResponse delete(final URI uri, Map<String, String> headers) throws IOException {
return call(uri, "DELETE", headers, null);
}
public WeDeployResponse delete(final URI uri, final String body) throws IOException {
return call(uri, "DELETE", Collections.emptyMap(), body);
}
public WeDeployResponse delete(final URI uri, final Map<String, String> headers, final String body) throws IOException {
return call(uri, "DELETE", headers, body);
}
}