no message
This commit is contained in:
31
src/_VisualDVM/Passes/All/DownloadBugReport.java
Normal file
31
src/_VisualDVM/Passes/All/DownloadBugReport.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.Repository.BugReport.BugReport;
|
||||
import _VisualDVM.Repository.BugReport.BugReportInterface;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
|
||||
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
|
||||
public class DownloadBugReport extends ComponentsRepositoryPass<BugReport> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
target = (BugReport) args[0];
|
||||
|
||||
|
||||
return !BugReportInterface.getArchiveFile(target).exists();
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
Utils.CheckDirectory(Global.BugReportsDirectory);
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveBugReport, target.id));
|
||||
Utils_.bytesToFile((byte[]) response.object, BugReportInterface.getArchiveFile(target));
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
return BugReportInterface.getArchiveFile(target).exists();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user