методы копирования
This commit is contained in:
@@ -109,14 +109,10 @@ public class UserConnection {
|
||||
//следует перенаправлять вывод в какой нибудь временный файл на сервере.
|
||||
public String ShellCommand(String command) throws Exception {
|
||||
StringBuilder result = new StringBuilder();
|
||||
// System.out.println("command=" + Utils.Brackets(command));
|
||||
pin.write((command + "\r\n").getBytes());
|
||||
ShellParser.ReadInvitation(fromServer); //первое приглашение после эхо. возможен мусор.
|
||||
result.append(ShellParser.getCommandResult(fromServer)); //возможный результат и второе приглашение.
|
||||
// System.out.println("answer=" + Utils.Brackets(result));
|
||||
//в реалиях визуалиазтора нас интересует только ПОСЛЕДНЯЯ СТРОКА ОТВЕТА.
|
||||
String[] data = result.toString().split("\n");
|
||||
// System.out.println("res="+Utils.Brackets(res));
|
||||
return (data.length > 0) ? data[data.length - 1] : result.toString();
|
||||
}
|
||||
public void getSingleFile(String src, String dst) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user