System.out.println("(" + Thread.currentThread() + ") [JarEntryFile.getContents()] Creating ZipFile on " +zipFile.getName()); //$NON-NLS-1$ //$NON-NLS-2$
}
String entryName = getEntryName();
ZipEntry zipEntry = zipFile.getEntry(entryName);
if (zipEntry == null){
throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryName));
}
byte[] contents = Util.getZipEntryByteContent(zipEntry, zipFile);
return new ByteArrayInputStream(contents);
} catch (IOException e){
throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION);
} finally {
// avoid leaking ZipFiles
JavaModelManager.getJavaModelManager().closeZipFile(zipFile);
}
}