2024-10-14 12:14:01 +03:00
|
|
|
package _VisualDVM.Passes.All;
|
2024-10-11 00:00:30 +03:00
|
|
|
import Common.Utils.Utils_;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
2024-10-14 12:14:01 +03:00
|
|
|
import _VisualDVM.Passes.SSH.CurrentConnectionPass;
|
2023-09-17 22:13:42 +03:00
|
|
|
public class RemoteSingleCommand extends CurrentConnectionPass<String> {
|
|
|
|
|
String command = "";
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean canStart(Object... args) {
|
|
|
|
|
if (super.canStart(args)) {
|
|
|
|
|
command = (String) args[0];
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void ServerAction() throws Exception {
|
2024-10-11 00:00:30 +03:00
|
|
|
RemoteFile file = new RemoteFile(user.connection.sftpChannel.getHome(), Utils_.getDateName("out"));
|
|
|
|
|
user.connection.Command(command + " 1>" + Utils_.DQuotes(file.full_name));
|
2024-03-29 01:39:14 +03:00
|
|
|
if (user.connection.Exists(file)) {
|
2024-01-08 20:37:16 +03:00
|
|
|
target = user.connection.readFromFile(file);
|
2024-03-29 01:39:14 +03:00
|
|
|
user.connection.sftpChannel.rm(file.full_name);
|
2024-01-08 20:37:16 +03:00
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
}
|