@@ -61,7 +61,7 @@ public class OpenTok {
61
61
* @param apiSecret Your OpenTok API secret. (See the <a href="https://dashboard.tokbox.com">OpenTok dashboard</a>
62
62
* page.)
63
63
*/
64
- public OpenTok (int apiKey , String apiSecret ) {
64
+ public OpenTok (int apiKey , String apiSecret ) {
65
65
this .apiKey = apiKey ;
66
66
this .apiSecret = apiSecret ;
67
67
this .client = new HttpClient .Builder (apiKey , apiSecret ).build ();
@@ -124,7 +124,8 @@ private OpenTok(int apiKey, String apiSecret, HttpClient httpClient) {
124
124
*
125
125
* @return The token string.
126
126
*/
127
- public String generateToken (String sessionId , TokenOptions tokenOptions ) throws OpenTokException {
127
+ public String generateToken (String sessionId , TokenOptions tokenOptions )
128
+ throws OpenTokException {
128
129
List <String > sessionIdParts = null ;
129
130
if (sessionId == null || sessionId == "" ) {
130
131
throw new InvalidArgumentException ("Session not valid" );
@@ -246,14 +247,13 @@ public Session createSession(SessionProperties properties) throws OpenTokExcepti
246
247
String xpathQuery = "/sessions/Session/session_id" ;
247
248
248
249
// NOTE: doing this null check twice is kind of ugly
249
- if (properties != null ) {
250
+ if (properties != null ) {
250
251
params = properties .toMap ();
251
252
} else {
252
253
params = new SessionProperties .Builder ().build ().toMap ();
253
254
}
254
-
255
- String xmlResponse = this .client .createSession (params );
256
255
256
+ String xmlResponse = this .client .createSession (params );
257
257
258
258
// NOTE: doing this null check twice is kind of ugly
259
259
try {
@@ -263,7 +263,8 @@ public Session createSession(SessionProperties properties) throws OpenTokExcepti
263
263
return new Session (readXml (xpathQuery , xmlResponse ), apiKey , apiSecret );
264
264
}
265
265
} 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 );
267
268
}
268
269
}
269
270
@@ -315,7 +316,7 @@ private static String readXml(String xpathQuery, String xml) throws XPathExpress
315
316
InputSource source = new InputSource (new StringReader (xml ));
316
317
return xpath .evaluate (xpathQuery , source );
317
318
}
318
-
319
+
319
320
/**
320
321
* Gets an {@link Archive} object for the given archive ID.
321
322
*
@@ -434,7 +435,7 @@ public Archive stopArchive(String archiveId) throws OpenTokException {
434
435
throw new RequestException ("Exception mapping json: " + e .getMessage ());
435
436
}
436
437
}
437
-
438
+
438
439
/**
439
440
* Deletes an OpenTok archive.
440
441
* <p>
@@ -484,5 +485,4 @@ public OpenTok build() {
484
485
}
485
486
486
487
}
487
-
488
488
}
0 commit comments