Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.jdt.internal.core;
import  org.eclipse.core.resources.IStorage;
import  org.eclipse.core.runtime.CoreException;
A jar entry that represents a non-java file found in a JAR.

See also:
public class JarEntryFile  extends JarEntryResource {
	private static final IJarEntryResource[] NO_CHILDREN = new IJarEntryResource[0];
	public JarEntryFile(String simpleName) {
	public JarEntryResource clone(Object newParent) {
		JarEntryFile file = new JarEntryFile(this.);
		return file;
	public InputStream getContents() throws CoreException {
		ZipFile zipFile = null;
		try {
			zipFile = getZipFile();
				..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){
			byte[] contents = Util.getZipEntryByteContent(zipEntryzipFile);
			return new ByteArrayInputStream(contents);
catch (IOException e){
finally {
			// avoid leaking ZipFiles
		return ;
	public boolean isFile() {
		return true;
	public String toString() {
		return "JarEntryFile["+getEntryName()+"]"//$NON-NLS-2$ //$NON-NLS-1$
New to GrepCode? Check out our FAQ X