<s> package org . eclipse . jdt . internal . core ; import java . io . ByteArrayInputStream ; import java . io . IOException ; import java . io . InputStream ; import java . util . zip . ZipEntry ; import java . util . zip . ZipFile ; import org . eclipse . core . resources . IStorage ; import org . eclipse . core . runtime . CoreException ; import org . eclipse . jdt . core . IJarEntryResource ; import org . eclipse . jdt . core . IJavaModelStatusConstants ; import org . eclipse . jdt . core . JavaModelException ; import org . eclipse . jdt . internal . compiler . util . Util ; public class JarEntryFile extends JarEntryResource { private static final IJarEntryResource [ ] NO_CHILDREN = new IJarEntryResource [ 0 ] ; public JarEntryFile ( String simpleName ) { super ( simpleName ) ; } public JarEntryResource clone ( Object newParent ) { JarEntryFile file = new JarEntryFile ( this . simpleName ) ; file . setParent ( newParent ) ; return file ; } public InputStream getContents ( ) throws CoreException { ZipFile zipFile = null ; try { zipFile = getZipFile ( ) ; if ( JavaModelManager . ZIP_ACCESS_VERBOSE ) { System . out . println ( "(" + Thread . currentThread ( ) + "" + zipFile . getName ( ) ) ; } 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 { JavaModelManager . getJavaModelManager ( ) . closeZipFile ( zipFile ) ; } } public IJarEntryResource [ ] getChildren ( ) { return NO_CHILDREN ; } public boolean isFile ( ) { return true ; } public String toString ( ) { return "" + getEntryName ( ) + "]" ; } } </s>