use of com.thoughtworks.go.util.ZipUtil in project gocd by gocd.
the class FelixGoPluginOSGiFrameworkIntegrationTest method explodeBundleIntoDirectory.
private File explodeBundleIntoDirectory(ZipInputStream src, String destinationDir) throws IOException, URISyntaxException {
File destinationPluginBundleLocation = new File(TMP_DIR, destinationDir);
destinationPluginBundleLocation.mkdirs();
new ZipUtil().unzip(src, destinationPluginBundleLocation);
return destinationPluginBundleLocation;
}
use of com.thoughtworks.go.util.ZipUtil in project gocd by gocd.
the class DirHandler method handle.
public void handle(InputStream stream) throws IOException {
ZipInputStream zipInputStream = new ZipInputStream(stream);
LOG.info(format("[Agent Fetch Artifact] Downloading from '%s' to '%s'. Will read from Socket stream to compute MD5 and write to file", srcFile, destOnAgent.getAbsolutePath()));
long before = System.currentTimeMillis();
new ZipUtil(new ZipUtil.ZipEntryHandler() {
public void handleEntry(ZipEntry entry, InputStream stream) throws IOException {
LOG.info(format("[Agent Fetch Artifact] Downloading a directory from '%s' to '%s'. Handling the entry: '%s'", srcFile, destOnAgent.getAbsolutePath(), entry.getName()));
new ChecksumValidator(artifactMd5Checksums).validate(getSrcFilePath(entry), md5Hex(stream), checksumValidationPublisher);
}
}).unzip(zipInputStream, destOnAgent);
LOG.info(format("[Agent Fetch Artifact] Downloading a directory from '%s' to '%s'. Took: %sms", srcFile, destOnAgent.getAbsolutePath(), System.currentTimeMillis() - before));
}
use of com.thoughtworks.go.util.ZipUtil in project gocd by gocd.
the class LocalhostWithLargeDataSets method unzipDatabaseFile.
private static File unzipDatabaseFile(File dbDir) throws IOException {
ZipUtil unzipUtil = new ZipUtil();
String dataFileName = "5000pipelinesx4stagesx5buildplans.script";
File srcZip = new File(dbDir, dataFileName + ".zip");
unzipUtil.unzip(srcZip, dbDir);
File unzipped = new File(dbDir, dataFileName);
return unzipped;
}
use of com.thoughtworks.go.util.ZipUtil in project gocd by gocd.
the class CommandRepositoryInitializerIntegrationTest method getZippedCommandRepo.
private File getZippedCommandRepo(final String versionText) throws Exception {
File dir = TestFileUtil.createTempFolder("default");
File versionFile = TestFileUtil.createTestFile(dir, "version.txt");
FileUtils.writeStringToFile(versionFile, versionText);
TestFileUtil.createTestFile(dir, "snippet.xml");
File zipFile = TestFileUtil.createTempFile("defaultCommandSnippets.zip");
new ZipUtil().zipFolderContents(dir, zipFile);
return zipFile;
}
use of com.thoughtworks.go.util.ZipUtil in project gocd by gocd.
the class CommandRepositoryInitializerIntegrationTest method setUp.
@Before
public void setUp() {
tempFiles = new TempFiles();
initializer = new CommandRepositoryInitializer(new SystemEnvironment(), new ZipUtil(), null);
}
Aggregations