Skip to content

Commit 99ad765

Browse files
committed
better messaging in sample apps when system properties are not defined
1 parent 68a917b commit 99ad765

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

sample/Archiving/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Next, start the server using Gradle (which handles dependencies and setting up t
1919
$ gradle :sample/Archiving:run
2020
```
2121

22-
Or if you are using the Gradle Wrapper that is distributed with the project:
22+
Or if you are using the Gradle Wrapper that is distributed with the project, from the root project
23+
directory:
2324

2425
```
2526
$ ./gradlew :sample/Archiving:run

sample/Archiving/src/main/java/com/example/ArchivingServer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class ArchivingServer {
1818

1919
private static final String apiKey = System.getProperty("API_KEY");
2020
private static final String apiSecret = System.getProperty("API_SECRET");
21-
private static final OpenTok opentok = new OpenTok(Integer.parseInt(apiKey), apiSecret);
21+
private static OpenTok opentok;
2222
private static String sessionId;
2323

2424
public static void main(String[] args) throws OpenTokException {
@@ -28,6 +28,8 @@ public static void main(String[] args) throws OpenTokException {
2828
System.exit(-1);
2929
}
3030

31+
opentok = new OpenTok(Integer.parseInt(apiKey), apiSecret);
32+
3133
sessionId = opentok.createSession().getSessionId();
3234

3335
externalStaticFileLocation("./public");

sample/HelloWorld/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Next, start the server using Gradle (which handles dependencies and setting up t
2020
$ gradle :sample/HelloWorld:run
2121
```
2222

23-
Or if you are using the Gradle Wrapper that is distributed with the project:
23+
Or if you are using the Gradle Wrapper that is distributed with the project, from the root project
24+
directory:
2425

2526
```
2627
$ ./gradlew :sample/HelloWorld:run
@@ -93,10 +94,11 @@ a static class variable.
9394
public class HelloWorldServer {
9495

9596
// ...
96-
private static final OpenTok opentok = new OpenTok(Integer.parseInt(apiKey), apiSecret);
97+
private static OpenTok opentok;
9798

9899
public static void main(String[] args) throws OpenTokException {
99100
// ...
101+
opentok = new OpenTok(Integer.parseInt(apiKey), apiSecret);
100102
}
101103
}
102104
```

sample/HelloWorld/src/main/java/com/example/HelloWorldServer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class HelloWorldServer {
1313

1414
private static final String apiKey = System.getProperty("API_KEY");
1515
private static final String apiSecret = System.getProperty("API_SECRET");
16-
private static final OpenTok opentok = new OpenTok(Integer.parseInt(apiKey), apiSecret);
16+
private static OpenTok opentok;
1717
private static String sessionId;
1818

1919
public static void main(String[] args) throws OpenTokException {
@@ -23,6 +23,8 @@ public static void main(String[] args) throws OpenTokException {
2323
System.exit(-1);
2424
}
2525

26+
opentok = new OpenTok(Integer.parseInt(apiKey), apiSecret);
27+
2628
sessionId = opentok.createSession().getSessionId();
2729

2830
externalStaticFileLocation("./public");

0 commit comments

Comments
 (0)