package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
import _VisualDVM.Repository.Component.Component;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
public class DownloadComponent extends ComponentsRepositoryPass<Component> {
    @Override
    protected void ServerAction() throws Exception {
        target = Global.mainModule.getComponent();
        String packed = target.getComponentType() + "\n" + target.getFileName();
        Command(new ServerExchangeUnit_2021(ServerCode.ReceiveComponent, packed));
        Utils_.bytesToFile((byte[]) response.object, target.getNewFile());
    }
}
