]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6370 Remove coupling on guava 10 in CommandExecutor
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 22 May 2015 15:17:06 +0000 (17:17 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 28 May 2015 07:28:47 +0000 (09:28 +0200)
sonar-plugin-api/src/main/java/org/sonar/api/utils/command/CommandExecutor.java

index 4c540b207a279e06f150c49d55ad03fc182833e1..dfe44fabf4291e540025172c36d8f79fa001b55b 100644 (file)
  */
 package org.sonar.api.utils.command;
 
-import com.google.common.io.Closeables;
-import org.sonar.api.utils.log.Logger;
-import org.sonar.api.utils.log.Loggers;
-
-import javax.annotation.Nullable;
-
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
@@ -35,6 +29,10 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.annotation.Nullable;
+import org.apache.commons.io.IOUtils;
+import org.sonar.api.utils.log.Logger;
+import org.sonar.api.utils.log.Loggers;
 
 /**
  * Synchronously execute a native command line. It's much more limited than the Apache Commons Exec library.
@@ -144,9 +142,9 @@ public class CommandExecutor {
 
   private void closeStreams(@Nullable Process process) {
     if (process != null) {
-      Closeables.closeQuietly(process.getInputStream());
-      Closeables.closeQuietly(process.getOutputStream());
-      Closeables.closeQuietly(process.getErrorStream());
+      IOUtils.closeQuietly(process.getInputStream());
+      IOUtils.closeQuietly(process.getOutputStream());
+      IOUtils.closeQuietly(process.getErrorStream());
     }
   }