Package io.gem.api
Class SshUtils
java.lang.Object
io.gem.api.SshUtils
Class SshUtils.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyDirectory(org.apache.sshd.client.session.ClientSession session, String srcPath, String dstPath) It copies directory of sessions.static org.apache.sshd.client.session.ClientSessioncreateSession(org.apache.sshd.client.SshClient client, ConnectionConfig connConfig, long timeoutSeconds) This method is responsible for creating client sessions.static voidrunCommand(@NotNull org.apache.sshd.client.session.ClientSession session, String cmd, long timeoutSeconds, @NotNull SshResponse response) This method is responsible for running commands.
-
Constructor Details
-
SshUtils
public SshUtils()
-
-
Method Details
-
createSession
public static org.apache.sshd.client.session.ClientSession createSession(org.apache.sshd.client.SshClient client, ConnectionConfig connConfig, long timeoutSeconds) throws IOException This method is responsible for creating client sessions.- Parameters:
client- SshClientconnConfig- SshConnectiontimeoutSeconds- long- Returns:
- session
- Throws:
IOException- If it occurs
-
runCommand
public static void runCommand(@NotNull @NotNull org.apache.sshd.client.session.ClientSession session, String cmd, long timeoutSeconds, @NotNull @NotNull SshResponse response) throws IOException This method is responsible for running commands.- Parameters:
session- final NotNull ClientSessioncmd- StringtimeoutSeconds- longresponse- NotNull SshResponseStream- Throws:
IOException- If it occurs
-
copyDirectory
public static void copyDirectory(org.apache.sshd.client.session.ClientSession session, String srcPath, String dstPath) throws IOException It copies directory of sessions.- Parameters:
session- final ClientSessionsrcPath- StringdstPath- String- Throws:
IOException- If it occurs.
-