no message

This commit is contained in:
2024-10-14 12:14:01 +03:00
parent 3a29898d5f
commit 452c4c7268
466 changed files with 1255 additions and 1100 deletions

View File

@@ -0,0 +1,46 @@
package _VisualDVM.Passes.All;
import Common.Visual.Windows.Dialog.Text.ReadOnlyMultilineTextForm;
import _VisualDVM.Utils;
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
import Common.Passes.PassException;
import _VisualDVM.Passes.Server.TestingSystemPass;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.List;
import java.util.Vector;
public class ShowTestingServerFile extends TestingSystemPass<RemoteFile> {
String title;
File localFile;
@Override
protected boolean canStart(Object... args) throws Exception {
title = (String) args[0];
target = (RemoteFile) args[1];
return true;
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveFile, target.full_name));
localFile = Utils.getTempFileName(target.name);
if (response.object != null)
response.Unpack(localFile);
else throw new PassException("Файл не найден");
}
@Override
protected boolean validate() {
return localFile.exists();
}
@Override
protected void showDone() throws Exception {
ReadOnlyMultilineTextForm ff = new ReadOnlyMultilineTextForm();
List<String> lines = FileUtils.readLines(localFile);
Vector<String> res = new Vector<>();
for (int i = lines.size() - 1; i >= 0; i--)
res.add(lines.get(i));
ff.ShowDialog(title,
String.join("\n", res)
);
}
}