test_class.file: bundles/org.openhab.core.io.net/src/test/java/org/openhab/core/io/net/exec/ExecUtilTest.java
test_class.identifier: ExecUtilTest
test_case.body: @Test
      public void testExecuteCommandLineAndWaitResponseWithArguments() {
          final String result;
          if (isWindowsSystem()) {
              result = ExecUtil.executeCommandLineAndWaitResponse("cmd@@/c@@echo@@test", 1000);
          } else {
              result = ExecUtil.executeCommandLineAndWaitResponse("echo@@'test'", 1000);
          }
          assertNotNull(result);
          assertNotEquals("test", result);
      }
test_case.class_method_signature: ExecUtilTest.testExecuteCommandLineAndWaitResponseWithArguments()
test_case.full_signature: @Test public void testExecuteCommandLineAndWaitResponseWithArguments()
test_case.identifier: testExecuteCommandLineAndWaitResponseWithArguments
test_case.invocations: isWindowsSystem executeCommandLineAndWaitResponse executeCommandLineAndWaitResponse assertNotNull assertNotEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecuteCommandLineAndWaitResponseWithArguments()
focal_class.declarator: logger = LoggerFactory.getLogger(ExecUtil.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger logger = LoggerFactory.getLogger(ExecUtil.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: CMD_LINE_DELIMITER = "@@"
focal_class.modifier: public static final
focal_class.original_string: public static final String CMD_LINE_DELIMITER = "@@";
focal_class.type: String
focal_class.var_name: CMD_LINE_DELIMITER
focal_class.file: bundles/org.openhab.core.io.net/src/main/java/org/openhab/core/io/net/exec/ExecUtil.java
focal_class.identifier: ExecUtil
focal_class.class_method_signature: ExecUtil.executeCommandLine(String commandLine)
focal_class.full_signature: public static void executeCommandLine(String commandLine)
focal_class.identifier: executeCommandLine
focal_class.modifiers: public static
focal_class.parameters: (String commandLine)
focal_class.return: void
focal_class.signature: void executeCommandLine(String commandLine)
focal_class.class_method_signature: ExecUtil.executeCommandLineAndWaitResponse(String commandLine, int timeout)
focal_class.full_signature: public static String executeCommandLineAndWaitResponse(String commandLine, int timeout)
focal_class.identifier: executeCommandLineAndWaitResponse
focal_class.modifiers: public static
focal_class.parameters: (String commandLine, int timeout)
focal_class.return: String
focal_class.signature: String executeCommandLineAndWaitResponse(String commandLine, int timeout)
focal_class.class_method_signature: ExecUtil.internalExecute(String commandLine)
focal_class.full_signature: private static @Nullable Process internalExecute(String commandLine)
focal_class.identifier: internalExecute
focal_class.modifiers: private static @Nullable
focal_class.parameters: (String commandLine)
focal_class.return: Process
focal_class.signature: Process internalExecute(String commandLine)
focal_method.body: public static String executeCommandLineAndWaitResponse(String commandLine, int timeout) {
          final Process process = internalExecute(commandLine);
          if (process != null) {
              try {
                  process.waitFor(timeout, TimeUnit.MILLISECONDS);
                  int exitCode = process.exitValue();
                  final StringBuilder result = new StringBuilder();
                  try (final BufferedReader reader = new BufferedReader(
                          new InputStreamReader(process.getInputStream()))) {
                      String line = "";
                      while ((line = reader.readLine()) != null) {
                          result.append(line).append("\n");
                      }
                  }
                  logger.debug("exit code '{}', result '{}'", exitCode, result);
                  return result.toString();
              } catch (IOException e) {
                  logger.debug("I/O exception occurred when executing commandLine '{}'", commandLine, e);
              } catch (InterruptedException e) {
                  logger.warn("Timeout occurred when executing commandLine '{}'", commandLine);
                  logger.debug("{}", e.getMessage(), e);
              }
          }
          return null;
      }
focal_method.class_method_signature: ExecUtil.executeCommandLineAndWaitResponse(String commandLine, int timeout)
focal_method.full_signature: public static String executeCommandLineAndWaitResponse(String commandLine, int timeout)
focal_method.identifier: executeCommandLineAndWaitResponse
focal_method.invocations: internalExecute waitFor exitValue getInputStream readLine append append debug toString debug warn debug getMessage
focal_method.modifiers: public static
focal_method.parameters: (String commandLine, int timeout)
focal_method.return: String
focal_method.signature: String executeCommandLineAndWaitResponse(String commandLine, int timeout)