diff --git a/fido2-demo/demo/src/main/java/com/linecorp/line/auth/fido/fido2/demo/config/EmbeddedRedisServerConfiguration.java b/fido2-demo/demo/src/main/java/com/linecorp/line/auth/fido/fido2/demo/config/EmbeddedRedisServerConfiguration.java index 4c792bb..e428704 100644 --- a/fido2-demo/demo/src/main/java/com/linecorp/line/auth/fido/fido2/demo/config/EmbeddedRedisServerConfiguration.java +++ b/fido2-demo/demo/src/main/java/com/linecorp/line/auth/fido/fido2/demo/config/EmbeddedRedisServerConfiguration.java @@ -70,6 +70,15 @@ private Process executeGrepProcessCommand(int port) throws IOException { return Runtime.getRuntime().exec(shell); } + /** + * @brief The executeGrepProcessWindowCommand function can be used as a replacement for the executeGrepProcessCommand function when running on Windows OS. + */ + private Process executeGrepProcessWindowCommand(int port) throws IOException { + String command = String.format("netstat -an | findstr :%d", port); + String[] shell = {"cmd.exe", "/c", command}; + return Runtime.getRuntime().exec(shell); + } + private boolean isRunning(Process process) { String line; StringBuilder pidInfo = new StringBuilder();