Java Code Examples for de.schlichtherle.truezip.zip.ZipFile#getEntry()

The following examples show how to use de.schlichtherle.truezip.zip.ZipFile#getEntry() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: chipster   File: ZipContentHandler.java    License: MIT License 5 votes vote down vote up
@Override
public Long getContentLength(ContentLocation location) throws IOException {
	checkCompatibility(location);
	ZipFile zipFile = createZipFile(location);
	ZipEntry zipEntry = zipFile.getEntry(location.getUrl().getRef());
	return zipEntry.getSize();
}
 
Example 2
Source Project: chipster   File: ZipContentHandler.java    License: MIT License 5 votes vote down vote up
@Override
public InputStream getInputStream(ContentLocation location) throws IOException {
	checkCompatibility(location);
	ZipFile zipFile = createZipFile(location);
	ZipEntry zipEntry = zipFile.getEntry(location.getUrl().getRef());
	return zipFile.getInputStream(zipEntry);
}
 
Example 3
Source Project: chipster   File: ZipContentHandler.java    License: MIT License 5 votes vote down vote up
@Override
public boolean isAccessible(ContentLocation location) {
	checkCompatibility(location);
	try {
		ZipFile zipFile = createZipFile(location);
		return zipFile.getEntry(location.getUrl().getRef()) != null;
	} catch (IOException e) {
		return false;
	}
}