All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.skjolber.unzip.UrlZipFileFactory Maven / Gradle / Ivy

There is a newer version: 1.0.10
Show newest version
package com.github.skjolber.unzip;

import java.io.IOException;
import java.net.URL;

import org.apache.commons.compress.archivers.zip.ZipFile;

public class UrlZipFileFactory implements ZipFileSource {

	protected UrlByteChannelCache cache;
	
	public UrlZipFileFactory(URL url, int chunkLength) {
		this(url, chunkLength, -1);
	}

	public UrlZipFileFactory(URL url, int chunkLength, int concurrentConnections) {
		cache = new UrlByteChannelCache(url, chunkLength, concurrentConnections);
	}

	public ZipFile getZipFile() throws IOException {
		return new ZipFile(new UrlSeekableByteChannel(cache));
	}
	
	public int size() throws IOException {
		return cache.getSize();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy