Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from olyabobra/master
Olga: adding different RestServer support for Waitrest
- Loading branch information
Showing
3 changed files
with
35 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
package com.googlecode.waitrest; | ||
|
||
import static com.googlecode.waitrest.Waitrest.serverProperties; | ||
|
||
public class Main { | ||
public static void main(String[] args) throws Exception { | ||
new Waitrest(port(args)); | ||
} | ||
|
||
private static Integer port(String[] args) { | ||
Integer port = null; | ||
if (args.length > 0) { | ||
try { | ||
port = Integer.parseInt(args[0]); | ||
} catch (Exception ex) { | ||
throw new IllegalArgumentException("The port " + args[0] + " should be an integer"); | ||
} | ||
} | ||
return port; | ||
String serverPort = (args.length > 0)? args[0]: null; | ||
String serverClass = (args.length > 1)? args[1]: null; | ||
new Waitrest(serverProperties(null, serverPort, serverClass)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters