23
23
import com .opentok .api .constants .SessionProperties ;
24
24
import com .opentok .exception .OpenTokException ;
25
25
import com .opentok .exception .OpenTokInvalidArgumentException ;
26
+ import com .opentok .util .HttpClient ;
26
27
import org .xml .sax .InputSource ;
27
28
28
29
/**
@@ -39,7 +40,7 @@ public class OpenTok {
39
40
40
41
private int apiKey ;
41
42
private String apiSecret ;
42
- protected OpenTokHttpClient client ;
43
+ protected HttpClient client ;
43
44
44
45
/**
45
46
* Creates an OpenTokSDK object.
@@ -56,7 +57,7 @@ public OpenTok(int apiKey, String apiSecret) {
56
57
public OpenTok (int apiKey , String apiSecret , String apiUrl ) {
57
58
this .apiKey = apiKey ;
58
59
this .apiSecret = apiSecret .trim ();
59
- this .client = new OpenTokHttpClient .Builder (apiKey , apiSecret )
60
+ this .client = new HttpClient .Builder (apiKey , apiSecret )
60
61
.apiUrl (apiUrl )
61
62
.build ();
62
63
}
@@ -320,7 +321,7 @@ private static String readXml(String xpathQuery, String xml) throws XPathExpress
320
321
*/
321
322
// public Archive getArchive(String archiveId) throws OpenTokException {
322
323
// ObjectMapper mapper = new ObjectMapper();
323
- // String archive = OpenTokHttpClient .makeGetRequest("/v2/partner/" + this.apiKey + "/archive/" + archiveId);
324
+ // String archive = HttpClient .makeGetRequest("/v2/partner/" + this.apiKey + "/archive/" + archiveId);
324
325
// try {
325
326
// return mapper.readValue(archive, Archive.class);
326
327
// } catch (Exception e) {
@@ -352,7 +353,7 @@ private static String readXml(String xpathQuery, String xml) throws XPathExpress
352
353
*/
353
354
// public List<Archive> listArchives(int offset, int count) throws OpenTokException {
354
355
// ObjectMapper mapper = new ObjectMapper();
355
- // String archive = OpenTokHttpClient .makeGetRequest("/v2/partner/" + this.apiKey + "/archive?offset=" + offset + "&count="
356
+ // String archive = HttpClient .makeGetRequest("/v2/partner/" + this.apiKey + "/archive?offset=" + offset + "&count="
356
357
// + count);
357
358
// try {
358
359
// JsonNode node = mapper.readTree(archive);
@@ -384,7 +385,7 @@ private static String readXml(String xpathQuery, String xml) throws XPathExpress
384
385
// }
385
386
// HashMap<String, String> headers = new HashMap<String, String>();
386
387
// headers.put("content-type", "application/json");
387
- // String archive = OpenTokHttpClient .makePostRequest("/v2/partner/" + this.apiKey + "/archive", headers, null,
388
+ // String archive = HttpClient .makePostRequest("/v2/partner/" + this.apiKey + "/archive", headers, null,
388
389
// "{ \"sessionId\" : \"" + sessionId + "\", \"name\": \"" + name + "\" }");
389
390
// ObjectMapper mapper = new ObjectMapper();
390
391
// try {
@@ -406,7 +407,7 @@ private static String readXml(String xpathQuery, String xml) throws XPathExpress
406
407
// public Archive stopArchive(String archiveId) throws OpenTokException {
407
408
// HashMap<String, String> headers = new HashMap<String, String>();
408
409
// headers.put("content-type", "application/json");
409
- // String archive = OpenTokHttpClient .makePostRequest("/v2/partner/" + this.apiKey + "/archive/" + archiveId + "/stop", headers, null,
410
+ // String archive = HttpClient .makePostRequest("/v2/partner/" + this.apiKey + "/archive/" + archiveId + "/stop", headers, null,
410
411
// "");
411
412
// ObjectMapper mapper = new ObjectMapper();
412
413
// try {
@@ -426,6 +427,6 @@ private static String readXml(String xpathQuery, String xml) throws XPathExpress
426
427
* @param archiveId The archive ID of the archive you want to delete.
427
428
*/
428
429
// public void deleteArchive(String archiveId) throws OpenTokException {
429
- // OpenTokHttpClient .makeDeleteRequest("/v2/partner/" + this.apiKey + "/archive/" + archiveId);
430
+ // HttpClient .makeDeleteRequest("/v2/partner/" + this.apiKey + "/archive/" + archiveId);
430
431
// }
431
432
}
0 commit comments