package hh.dejsem.net;

import hh.dejsem.K;
import hh.dejsem.fm.NetTaskRef;
import hh.lib.D;

/**
 * copy to server asynchronously
 */
public class PushToServer extends ServerCopy {

	public PushToServer(D d, NetTaskRef netTaskRef) throws Exception  {
		super(d, netTaskRef);
	}

	@Override
	protected Void doInBackground(Void... params) {
		super.doInBackground();
		try { if(netTaskRef.go) netConn.pushSrv(); }
		catch(Exception e) { if(!K.End.class.isInstance(e)) abend(null, e); }
		return null;
	}

	@Override
	void completePostExecute() { notifyRefreshFileList(K.MSG_REFRESH_SRV); }
}
