Files
VisualSapfor/src/_VisualDVM/Passes/All/RemoteSingleCommand.java

25 lines
900 B
Java
Raw Normal View History

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));
if (user.connection.Exists(file)) {
target = user.connection.readFromFile(file);
user.connection.sftpChannel.rm(file.full_name);
}
2023-09-17 22:13:42 +03:00
}
}