1 11 package org.eclipse.jdt.internal.core; 12 13 import java.io.ByteArrayInputStream ; 14 import java.io.InputStream ; 15 16 import org.eclipse.core.runtime.CoreException; 17 import org.eclipse.jdt.core.IJarEntryResource; 18 19 public class JarEntryDirectory extends JarEntryResource { 20 private IJarEntryResource[] children; 21 22 public JarEntryDirectory(String simpleName) { 23 super(simpleName); 24 } 25 26 public JarEntryResource clone(Object newParent) { 27 JarEntryDirectory dir = new JarEntryDirectory(this.simpleName); 28 dir.setParent(newParent); 29 int length = this.children.length; 30 if (length > 0) { 31 IJarEntryResource[] newChildren = new IJarEntryResource[length]; 32 for (int i = 0; i < length; i++) { 33 JarEntryResource child = (JarEntryResource) this.children[i]; 34 newChildren[i] = child.clone(dir); 35 } 36 dir.setChildren(newChildren); 37 } 38 return dir; 39 } 40 41 public IJarEntryResource[] getChildren() { 42 return this.children; 43 } 44 45 public InputStream getContents() throws CoreException { 46 return new ByteArrayInputStream (new byte[0]); 47 } 48 49 public boolean isFile() { 50 return false; 51 } 52 53 public void setChildren(IJarEntryResource[] children) { 54 this.children = children; 55 } 56 57 public String toString() { 58 return "JarEntryDirectory["+getEntryName()+"]"; } 60 } 61 | Popular Tags |