use of com.google.devtools.build.lib.bazel.repository.DecompressorDescriptor in project bazel by bazelbuild.
the class CompressedTarFunctionTest method testDecompressWithPrefix.
/**
* Test decompressing a tar.gz file with hard link file and symbolic link file inside and
* stripping a prefix
*
* @throws Exception
*/
@Test
public void testDecompressWithPrefix() throws Exception {
descriptorBuilder.setPrefix(ROOT_FOLDER_NAME);
Path outputDir = new CompressedTarFunction() {
@Override
protected InputStream getDecompressorStream(DecompressorDescriptor descriptor) throws IOException {
return new GZIPInputStream(new FileInputStream(descriptor.archivePath().getPathFile()));
}
}.decompress(descriptorBuilder.build());
assertOutputFiles(outputDir.getRelative(INNER_FOLDER_NAME));
}
use of com.google.devtools.build.lib.bazel.repository.DecompressorDescriptor in project bazel by bazelbuild.
the class CompressedTarFunctionTest method testDecompressWithoutPrefix.
/**
* Test decompressing a tar.gz file with hard link file and symbolic link file inside without
* stripping a prefix
*
* @throws Exception
*/
@Test
public void testDecompressWithoutPrefix() throws Exception {
Path outputDir = new CompressedTarFunction() {
@Override
protected InputStream getDecompressorStream(DecompressorDescriptor descriptor) throws IOException {
return new GZIPInputStream(new FileInputStream(descriptor.archivePath().getPathFile()));
}
}.decompress(descriptorBuilder.build());
assertOutputFiles(outputDir.getRelative(ROOT_FOLDER_NAME).getRelative(INNER_FOLDER_NAME));
}
Aggregations