@Test void testClone() { gitService.clone(GitInfo.build(GIT_URL)); }
@Async("gitCloneExecutor") public void clone(GitInfo gitInfo) { log.debug("开始clone，git信息[{}]", gitInfo); Path tempDirectory; try { tempDirectory = Files.createTempDirectory(gitProxyProperties.getTempDirPath(), gitInfo.getRepositoryName()); } catch (IOException e) { throw new GitProxyException("创建临时文件夹失败！", e); } String tempDirectoryPath = tempDirectory.toString(); CommandResult result; try { result = CommandUtils.getResult("git clone " + gitInfo.getUrl(), tempDirectoryPath); } catch (ExecutionException e) { throw new GitProxyException("clone命令执行失败！", e); } catch (InterruptedException e) { throw new GitProxyException("clone操作中断！", e); } Assert.isTrue(CommandUtils.verify(result), result.getResult()); ZipUtil.zip(tempDirectoryPath, gitProxyProperties.getZipFilePath() + "\\" + tempDirectory.getFileName() + ".zip"); }
GitService { @Async("gitCloneExecutor") public void clone(GitInfo gitInfo) { log.debug("开始clone，git信息[{}]", gitInfo); Path tempDirectory; try { tempDirectory = Files.createTempDirectory(gitProxyProperties.getTempDirPath(), gitInfo.getRepositoryName()); } catch (IOException e) { throw new GitProxyException("创建临时文件夹失败！", e); } String tempDirectoryPath = tempDirectory.toString(); CommandResult result; try { result = CommandUtils.getResult("git clone " + gitInfo.getUrl(), tempDirectoryPath); } catch (ExecutionException e) { throw new GitProxyException("clone命令执行失败！", e); } catch (InterruptedException e) { throw new GitProxyException("clone操作中断！", e); } Assert.isTrue(CommandUtils.verify(result), result.getResult()); ZipUtil.zip(tempDirectoryPath, gitProxyProperties.getZipFilePath() + "\\" + tempDirectory.getFileName() + ".zip"); } }
GitService { @Async("gitCloneExecutor") public void clone(GitInfo gitInfo) { log.debug("开始clone，git信息[{}]", gitInfo); Path tempDirectory; try { tempDirectory = Files.createTempDirectory(gitProxyProperties.getTempDirPath(), gitInfo.getRepositoryName()); } catch (IOException e) { throw new GitProxyException("创建临时文件夹失败！", e); } String tempDirectoryPath = tempDirectory.toString(); CommandResult result; try { result = CommandUtils.getResult("git clone " + gitInfo.getUrl(), tempDirectoryPath); } catch (ExecutionException e) { throw new GitProxyException("clone命令执行失败！", e); } catch (InterruptedException e) { throw new GitProxyException("clone操作中断！", e); } Assert.isTrue(CommandUtils.verify(result), result.getResult()); ZipUtil.zip(tempDirectoryPath, gitProxyProperties.getZipFilePath() + "\\" + tempDirectory.getFileName() + ".zip"); }  }
GitService { @Async("gitCloneExecutor") public void clone(GitInfo gitInfo) { log.debug("开始clone，git信息[{}]", gitInfo); Path tempDirectory; try { tempDirectory = Files.createTempDirectory(gitProxyProperties.getTempDirPath(), gitInfo.getRepositoryName()); } catch (IOException e) { throw new GitProxyException("创建临时文件夹失败！", e); } String tempDirectoryPath = tempDirectory.toString(); CommandResult result; try { result = CommandUtils.getResult("git clone " + gitInfo.getUrl(), tempDirectoryPath); } catch (ExecutionException e) { throw new GitProxyException("clone命令执行失败！", e); } catch (InterruptedException e) { throw new GitProxyException("clone操作中断！", e); } Assert.isTrue(CommandUtils.verify(result), result.getResult()); ZipUtil.zip(tempDirectoryPath, gitProxyProperties.getZipFilePath() + "\\" + tempDirectory.getFileName() + ".zip"); }  @Async("gitCloneExecutor") void clone(GitInfo gitInfo); }
GitService { @Async("gitCloneExecutor") public void clone(GitInfo gitInfo) { log.debug("开始clone，git信息[{}]", gitInfo); Path tempDirectory; try { tempDirectory = Files.createTempDirectory(gitProxyProperties.getTempDirPath(), gitInfo.getRepositoryName()); } catch (IOException e) { throw new GitProxyException("创建临时文件夹失败！", e); } String tempDirectoryPath = tempDirectory.toString(); CommandResult result; try { result = CommandUtils.getResult("git clone " + gitInfo.getUrl(), tempDirectoryPath); } catch (ExecutionException e) { throw new GitProxyException("clone命令执行失败！", e); } catch (InterruptedException e) { throw new GitProxyException("clone操作中断！", e); } Assert.isTrue(CommandUtils.verify(result), result.getResult()); ZipUtil.zip(tempDirectoryPath, gitProxyProperties.getZipFilePath() + "\\" + tempDirectory.getFileName() + ".zip"); }  @Async("gitCloneExecutor") void clone(GitInfo gitInfo);  }