From 4dbdfa508246ac34e54250c52107f497c0a8aa36 Mon Sep 17 00:00:00 2001
From: buczekp <buczekp>
Date: Tue, 2 Feb 2010 10:17:21 +0000
Subject: [PATCH] [LMS-1352] missing commit

SVN: 14603
---
 .../filesystem/ssh/ISshCommandExecutor.java   | 41 +++++++++++++++++++
 .../filesystem/ssh/SshCommandExecutor.java    |  4 +-
 2 files changed, 43 insertions(+), 2 deletions(-)
 create mode 100644 common/source/java/ch/systemsx/cisd/common/filesystem/ssh/ISshCommandExecutor.java

diff --git a/common/source/java/ch/systemsx/cisd/common/filesystem/ssh/ISshCommandExecutor.java b/common/source/java/ch/systemsx/cisd/common/filesystem/ssh/ISshCommandExecutor.java
new file mode 100644
index 00000000000..c07c37c2286
--- /dev/null
+++ b/common/source/java/ch/systemsx/cisd/common/filesystem/ssh/ISshCommandExecutor.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2010 ETH Zuerich, CISD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package ch.systemsx.cisd.common.filesystem.ssh;
+
+import java.io.File;
+
+import ch.systemsx.cisd.common.filesystem.BooleanStatus;
+import ch.systemsx.cisd.common.process.ProcessResult;
+
+/**
+ * @author Piotr Buczek
+ */
+public interface ISshCommandExecutor
+{
+
+    public abstract BooleanStatus exists(File file, final long timeOutMillis);
+
+    public abstract BooleanStatus checkDirectoryAccessible(final String pathString,
+            final long timeOutMillis);
+
+    public abstract ProcessResult tryExecuteCommandRemotely(final String localCmd,
+            final long timeOutMillis);
+
+    public abstract ProcessResult tryExecuteCommandRemotely(final String localCmd,
+            final long timeOutMillis, final boolean logResult);
+
+}
\ No newline at end of file
diff --git a/common/source/java/ch/systemsx/cisd/common/filesystem/ssh/SshCommandExecutor.java b/common/source/java/ch/systemsx/cisd/common/filesystem/ssh/SshCommandExecutor.java
index 48cc7c35351..4ae11a145e8 100644
--- a/common/source/java/ch/systemsx/cisd/common/filesystem/ssh/SshCommandExecutor.java
+++ b/common/source/java/ch/systemsx/cisd/common/filesystem/ssh/SshCommandExecutor.java
@@ -37,7 +37,7 @@ import ch.systemsx.cisd.common.process.ProcessExecutionHelper.OutputReadingStrat
  * 
  * @author Piotr Buczek
  */
-public class SshCommandExecutor implements Serializable
+public class SshCommandExecutor implements ISshCommandExecutor, Serializable
 {
     private static final long serialVersionUID = 1L;
 
@@ -62,7 +62,7 @@ public class SshCommandExecutor implements Serializable
         this.sshCommandBuilder = sshCommandBuilder;
     }
 
-    public String getHost()
+    private String getHost()
     {
         assert host != null : "host cannot be null";
         return host;
-- 
GitLab