public ReadableResource maybeCompressed(Object tarPath) { if (tarPath instanceof ReadableResource) { return (ReadableResource) tarPath; } else { return new MaybeCompressedFileResource(fileOperations.getFileResolver().resolveResource(tarPath)); } }
public MaybeCompressedFileResource(ReadableResource resource) { String ext = FilenameUtils.getExtension(resource.getURI().toString()); if (Compression.BZIP2.getSupportedExtensions().contains(ext)) { this.resource = new Bzip2Archiver(resource); } else if (Compression.GZIP.getSupportedExtensions().contains(ext)) { this.resource = new GzipArchiver(resource); } else { this.resource = resource; } }
public ReadableResource maybeCompressed(Object tarPath) { if (tarPath instanceof ReadableResource) { return (ReadableResource) tarPath; } else { return new MaybeCompressedFileResource(resolver.resolveResource(tarPath)); } }
public UnknownBackingFileReadableResource(ReadableResource resource) { this.resource = resource; }
public ReadableResource getResource() { return resource; }
public ReadableResource gzip(Object path) { return new GzipArchiver(fileOperations.getFileResolver().resolveResource(path)); }
public ReadableResource bzip2(Object path) { return new Bzip2Archiver(fileOperations.getFileResolver().resolveResource(path)); }
public TarFileTree(ReadableResource resource, File tmpDir, Chmod chmod) { this.resource = resource; this.chmod = chmod; String expandDirName = String.format("%s_%s", resource.getBaseName(), HashUtil.createCompactMD5(resource.getURI().toString())); this.tmpDir = new File(tmpDir, expandDirName); }
public GzipArchiver(ReadableResource resource) { assert resource != null; this.resource = resource; this.uri = new URIBuilder(resource.getURI()).schemePrefix("gzip:").build(); }
public Bzip2Archiver(ReadableResource resource) { assert resource != null; this.resource = resource; this.uri = new URIBuilder(resource.getURI()).schemePrefix("bzip2:").build(); }
public ReadableResource resolveResource(Object path) { if (path instanceof ReadableResource) { return (ReadableResource) path; } return new FileResource(resolve(path)); }
public ReadableResource gzip(Object path) { return new GzipArchiver(resolver.resolveResource(path)); }
public ReadableResource bzip2(Object path) { return new Bzip2Archiver(resolver.resolveResource(path)); }
@Override public ReadableResource resolveResource(final Object path) { return null; }
ReadableResource resolveResource(Object path);