Skip to content

Commit c005f06

Browse files
committed
styling and formating changes applied
1 parent a89ef52 commit c005f06

File tree

2 files changed

+388
-356
lines changed

2 files changed

+388
-356
lines changed

src/main/java/com/opentok/OpenTok.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public class OpenTok {
5353
private HttpClient client;
5454
static protected ObjectReader archiveReader = new ObjectMapper().reader(Archive.class);
5555
static protected ObjectReader archiveListReader = new ObjectMapper().reader(ArchiveList.class);
56-
5756

5857
/**
5958
* Creates an OpenTok object.
@@ -68,20 +67,17 @@ public class OpenTok {
6867
* page.)
6968
*/
7069
public OpenTok(int apiKey, String apiSecret) {
71-
7270
this.apiKey = apiKey;
7371
this.apiSecret = apiSecret;
7472
this.client = new HttpClient.Builder(apiKey, apiSecret).build();
7573
}
76-
74+
7775
private OpenTok(int apiKey, String apiSecret, HttpClient httpClient) {
78-
7976
this.apiKey = apiKey;
8077
this.apiSecret = apiSecret;
81-
this.client=httpClient;
82-
83-
}
78+
this.client = httpClient;
8479

80+
}
8581

8682
/**
8783
* Creates a token for connecting to an OpenTok session. In order to
@@ -114,7 +110,8 @@ private OpenTok(int apiKey, String apiSecret, HttpClient httpClient) {
114110
* String role = Role.SUBSCRIBER;
115111
*
116112
* // Generate a token:
117-
* TokenOptions options = new TokenOptions.Buider().role(role).data(connectionMetadata).build();
113+
* TokenOptions options = new TokenOptions.Buider().role(role).data(connectionMetadata)
114+
* .build();
118115
* String token = sdk.generateToken(sessionId, options);
119116
* System.out.println(token);
120117
* }
@@ -142,7 +139,8 @@ private OpenTok(int apiKey, String apiSecret, HttpClient httpClient) {
142139
*
143140
* @return The token string.
144141
*/
145-
public String generateToken(String sessionId, TokenOptions tokenOptions) throws OpenTokException {
142+
public String generateToken(String sessionId, TokenOptions tokenOptions)
143+
throws OpenTokException {
146144
List<String> sessionIdParts = null;
147145
if (sessionId == null || sessionId == "") {
148146
throw new InvalidArgumentException("Session not valid");
@@ -243,7 +241,8 @@ public String generateToken(String sessionId) throws OpenTokException {
243241
* String API_SECRET = ""; // Replace with your OpenTok API secret.
244242
* OpenTok sdk = new OpenTok(API_KEY, API_SECRET);
245243
*
246-
* SessionProperties sp = new SessionProperties().Builder().mediaMode(MediaMode.RELAYED).build();
244+
* SessionProperties sp = new SessionProperties().Builder().mediaMode(MediaMode.RELAYED)
245+
* .build();
247246
*
248247
* Session session = sdk.createSession(sp);
249248
* System.out.println(session.getSessionId());
@@ -294,7 +293,8 @@ public Session createSession(SessionProperties properties) throws OpenTokExcepti
294293
return new Session(readXml(xpathQuery, xmlResponse), apiKey, apiSecret);
295294
}
296295
} catch (XPathExpressionException e) {
297-
throw new OpenTokException("Cannot create session. Could not read the response: " + xmlResponse);
296+
throw new OpenTokException(
297+
"Cannot create session. Could not read the response: " + xmlResponse);
298298
}
299299
}
300300

@@ -437,7 +437,8 @@ public ArchiveList listArchives(int offset, int count) throws OpenTokException {
437437
* @return The Archive object. This object includes properties defining the
438438
* archive, including the archive ID.
439439
*/
440-
public Archive startArchive(String sessionId, ArchiveProperties properties) throws OpenTokException {
440+
public Archive startArchive(String sessionId, ArchiveProperties properties)
441+
throws OpenTokException {
441442
if (sessionId == null || sessionId == "") {
442443
throw new InvalidArgumentException("Session not valid");
443444
}
@@ -516,19 +517,17 @@ public Builder proxy(Proxy proxy) {
516517
}
517518

518519
public OpenTok build() {
519-
520520
HttpClient.Builder clientBuilder = new HttpClient.Builder(apiKey, apiSecret);
521-
521+
522522
if (this.apiUrl != null) {
523523
clientBuilder.apiUrl(this.apiUrl);
524524
}
525-
if (this.proxy!=null) {
525+
if (this.proxy != null) {
526526
clientBuilder.proxy(this.proxy);
527527
}
528528

529529
return new OpenTok(this.apiKey, this.apiSecret, clientBuilder.build());
530530

531-
532531
}
533532

534533
}

0 commit comments

Comments
 (0)