no message
This commit is contained in:
24
src/_VisualDVM/Passes/All/RemoteSingleCommand.java
Normal file
24
src/_VisualDVM/Passes/All/RemoteSingleCommand.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
import _VisualDVM.Passes.SSH.CurrentConnectionPass;
|
||||
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 {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user