@Test public void download() { System.out.print("abcdefg"); System.out.print("\b"); System.out.print("\b"); System.out.print("\b"); }
private boolean download(String url, String filePath, String signature) throws IOException { if (!upgrading) { setFailedMessage("The upgrade has stopped"); return false; } byte[] bytes = HttpDownloadUtils.download(url); if (!verifySig(bytes, Hex.decode(signature))) { setFailedMessage("Signature verification is incorrect:" + url); return false; } boolean result = FileUtil.writeFile(bytes, filePath); if (!result) { setFailedMessage("Write file failed:" + filePath); } return result; }
UpgradeThread implements Runnable { private boolean download(String url, String filePath, String signature) throws IOException { if (!upgrading) { setFailedMessage("The upgrade has stopped"); return false; } byte[] bytes = HttpDownloadUtils.download(url); if (!verifySig(bytes, Hex.decode(signature))) { setFailedMessage("Signature verification is incorrect:" + url); return false; } boolean result = FileUtil.writeFile(bytes, filePath); if (!result) { setFailedMessage("Write file failed:" + filePath); } return result; } }
UpgradeThread implements Runnable { private boolean download(String url, String filePath, String signature) throws IOException { if (!upgrading) { setFailedMessage("The upgrade has stopped"); return false; } byte[] bytes = HttpDownloadUtils.download(url); if (!verifySig(bytes, Hex.decode(signature))) { setFailedMessage("Signature verification is incorrect:" + url); return false; } boolean result = FileUtil.writeFile(bytes, filePath); if (!result) { setFailedMessage("Write file failed:" + filePath); } return result; } private  UpgradeThread(); }
UpgradeThread implements Runnable { private boolean download(String url, String filePath, String signature) throws IOException { if (!upgrading) { setFailedMessage("The upgrade has stopped"); return false; } byte[] bytes = HttpDownloadUtils.download(url); if (!verifySig(bytes, Hex.decode(signature))) { setFailedMessage("Signature verification is incorrect:" + url); return false; } boolean result = FileUtil.writeFile(bytes, filePath); if (!result) { setFailedMessage("Write file failed:" + filePath); } return result; } private  UpgradeThread(); static UpgradeThread getInstance(); @Override void run(); boolean start(); boolean stop(); boolean isUpgrading(); UpgradeProcessDTO getProcess(); }
UpgradeThread implements Runnable { private boolean download(String url, String filePath, String signature) throws IOException { if (!upgrading) { setFailedMessage("The upgrade has stopped"); return false; } byte[] bytes = HttpDownloadUtils.download(url); if (!verifySig(bytes, Hex.decode(signature))) { setFailedMessage("Signature verification is incorrect:" + url); return false; } boolean result = FileUtil.writeFile(bytes, filePath); if (!result) { setFailedMessage("Write file failed:" + filePath); } return result; } private  UpgradeThread(); static UpgradeThread getInstance(); @Override void run(); boolean start(); boolean stop(); boolean isUpgrading(); UpgradeProcessDTO getProcess();  }