Skip to content

Commit 3c35002

Browse files
committed
File replaced with default formatting and required changes
1 parent 12bdb3f commit 3c35002

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class OpenTok {
6161
* @param apiSecret Your OpenTok API secret. (See the <a href="https://dashboard.tokbox.com">OpenTok dashboard</a>
6262
* page.)
6363
*/
64-
public OpenTok(int apiKey, String apiSecret) {
64+
public OpenTok(int apiKey, String apiSecret) {
6565
this.apiKey = apiKey;
6666
this.apiSecret = apiSecret;
6767
this.client = new HttpClient.Builder(apiKey, apiSecret).build();
@@ -124,7 +124,8 @@ private OpenTok(int apiKey, String apiSecret, HttpClient httpClient) {
124124
*
125125
* @return The token string.
126126
*/
127-
public String generateToken(String sessionId, TokenOptions tokenOptions) throws OpenTokException {
127+
public String generateToken(String sessionId, TokenOptions tokenOptions)
128+
throws OpenTokException {
128129
List<String> sessionIdParts = null;
129130
if(sessionId == null || sessionId == "") {
130131
throw new InvalidArgumentException("Session not valid");
@@ -246,14 +247,13 @@ public Session createSession(SessionProperties properties) throws OpenTokExcepti
246247
String xpathQuery = "/sessions/Session/session_id";
247248

248249
// NOTE: doing this null check twice is kind of ugly
249-
if(properties != null) {
250+
if (properties != null) {
250251
params = properties.toMap();
251252
} else {
252253
params = new SessionProperties.Builder().build().toMap();
253254
}
254-
255-
String xmlResponse = this.client.createSession(params);
256255

256+
String xmlResponse = this.client.createSession(params);
257257

258258
// NOTE: doing this null check twice is kind of ugly
259259
try {
@@ -263,7 +263,8 @@ public Session createSession(SessionProperties properties) throws OpenTokExcepti
263263
return new Session(readXml(xpathQuery, xmlResponse), apiKey, apiSecret);
264264
}
265265
} catch (XPathExpressionException e) {
266-
throw new OpenTokException("Cannot create session. Could not read the response: " + xmlResponse);
266+
throw new OpenTokException(
267+
"Cannot create session. Could not read the response: " + xmlResponse);
267268
}
268269
}
269270

@@ -315,7 +316,7 @@ private static String readXml(String xpathQuery, String xml) throws XPathExpress
315316
InputSource source = new InputSource(new StringReader(xml));
316317
return xpath.evaluate(xpathQuery, source);
317318
}
318-
319+
319320
/**
320321
* Gets an {@link Archive} object for the given archive ID.
321322
*
@@ -434,7 +435,7 @@ public Archive stopArchive(String archiveId) throws OpenTokException {
434435
throw new RequestException("Exception mapping json: " + e.getMessage());
435436
}
436437
}
437-
438+
438439
/**
439440
* Deletes an OpenTok archive.
440441
* <p>
@@ -484,5 +485,4 @@ public OpenTok build() {
484485
}
485486

486487
}
487-
488488
}

0 commit comments

Comments
 (0)