@Test public void testCenterDownload() throws IOException { String version = "3.1.7"; File folder = rootFolder.newFolder(); System.err.println(folder.getAbsolutePath()); DownloadUtils.downArthasPackaging("center", false, version, folder.getAbsolutePath()); File as = new File(folder, version + File.separator + "arthas" + File.separator + "as.sh"); Assert.assertTrue(as.exists()); }
public static void downArthasPackaging(String repoMirror, boolean http, String arthasVersion, String savePath) throws IOException { String repoUrl = getRepoUrl(ARTHAS_DOWNLOAD_URL, http); File unzipDir = new File(savePath, arthasVersion + File.separator + "arthas"); File tempFile = File.createTempFile("arthas", "arthas"); AnsiLog.debug("Arthas download temp file: " + tempFile.getAbsolutePath()); String remoteDownloadUrl = repoUrl.replace("${REPO}", repoMirror).replace("${VERSION}", arthasVersion); AnsiLog.info("Start download arthas from remote server: " + remoteDownloadUrl); saveUrl(tempFile.getAbsolutePath(), remoteDownloadUrl, true); AnsiLog.info("Download arthas success."); IOUtils.unzip(tempFile.getAbsolutePath(), unzipDir.getAbsolutePath()); }
DownloadUtils { public static void downArthasPackaging(String repoMirror, boolean http, String arthasVersion, String savePath) throws IOException { String repoUrl = getRepoUrl(ARTHAS_DOWNLOAD_URL, http); File unzipDir = new File(savePath, arthasVersion + File.separator + "arthas"); File tempFile = File.createTempFile("arthas", "arthas"); AnsiLog.debug("Arthas download temp file: " + tempFile.getAbsolutePath()); String remoteDownloadUrl = repoUrl.replace("${REPO}", repoMirror).replace("${VERSION}", arthasVersion); AnsiLog.info("Start download arthas from remote server: " + remoteDownloadUrl); saveUrl(tempFile.getAbsolutePath(), remoteDownloadUrl, true); AnsiLog.info("Download arthas success."); IOUtils.unzip(tempFile.getAbsolutePath(), unzipDir.getAbsolutePath()); } }
DownloadUtils { public static void downArthasPackaging(String repoMirror, boolean http, String arthasVersion, String savePath) throws IOException { String repoUrl = getRepoUrl(ARTHAS_DOWNLOAD_URL, http); File unzipDir = new File(savePath, arthasVersion + File.separator + "arthas"); File tempFile = File.createTempFile("arthas", "arthas"); AnsiLog.debug("Arthas download temp file: " + tempFile.getAbsolutePath()); String remoteDownloadUrl = repoUrl.replace("${REPO}", repoMirror).replace("${VERSION}", arthasVersion); AnsiLog.info("Start download arthas from remote server: " + remoteDownloadUrl); saveUrl(tempFile.getAbsolutePath(), remoteDownloadUrl, true); AnsiLog.info("Download arthas success."); IOUtils.unzip(tempFile.getAbsolutePath(), unzipDir.getAbsolutePath()); }  }
DownloadUtils { public static void downArthasPackaging(String repoMirror, boolean http, String arthasVersion, String savePath) throws IOException { String repoUrl = getRepoUrl(ARTHAS_DOWNLOAD_URL, http); File unzipDir = new File(savePath, arthasVersion + File.separator + "arthas"); File tempFile = File.createTempFile("arthas", "arthas"); AnsiLog.debug("Arthas download temp file: " + tempFile.getAbsolutePath()); String remoteDownloadUrl = repoUrl.replace("${REPO}", repoMirror).replace("${VERSION}", arthasVersion); AnsiLog.info("Start download arthas from remote server: " + remoteDownloadUrl); saveUrl(tempFile.getAbsolutePath(), remoteDownloadUrl, true); AnsiLog.info("Download arthas success."); IOUtils.unzip(tempFile.getAbsolutePath(), unzipDir.getAbsolutePath()); }  static String readLatestReleaseVersion(); static List<String> readRemoteVersions(); static void downArthasPackaging(String repoMirror, boolean http, String arthasVersion, String savePath); }
DownloadUtils { public static void downArthasPackaging(String repoMirror, boolean http, String arthasVersion, String savePath) throws IOException { String repoUrl = getRepoUrl(ARTHAS_DOWNLOAD_URL, http); File unzipDir = new File(savePath, arthasVersion + File.separator + "arthas"); File tempFile = File.createTempFile("arthas", "arthas"); AnsiLog.debug("Arthas download temp file: " + tempFile.getAbsolutePath()); String remoteDownloadUrl = repoUrl.replace("${REPO}", repoMirror).replace("${VERSION}", arthasVersion); AnsiLog.info("Start download arthas from remote server: " + remoteDownloadUrl); saveUrl(tempFile.getAbsolutePath(), remoteDownloadUrl, true); AnsiLog.info("Download arthas success."); IOUtils.unzip(tempFile.getAbsolutePath(), unzipDir.getAbsolutePath()); }  static String readLatestReleaseVersion(); static List<String> readRemoteVersions(); static void downArthasPackaging(String repoMirror, boolean http, String arthasVersion, String savePath);  }