package Visual_DVM_2021.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Current;
import _VisualDVM.Global;
import _VisualDVM.Repository.Component.Component;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
import Visual_DVM_2021.Passes.Server.ComponentsRepositoryPass;
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());
    }
}
