1 package spoon.support.builder.support; 2 3 import java.io.ByteArrayInputStream ; 4 import java.io.InputStream ; 5 6 import spoon.support.builder.CtFile; 7 import spoon.support.builder.CtFolder; 8 9 public class CtFileZip implements CtFile { 10 11 byte[] buffer; 12 13 String name; 14 15 CtFolderZip parent; 16 17 public CtFileZip(CtFolderZip parent, String name, byte[] buffer) { 18 super(); 19 this.buffer = buffer; 20 this.name = name; 21 this.parent = parent; 22 } 23 24 public InputStream getContent() { 25 return new ByteArrayInputStream (buffer); 26 } 27 28 public String getName() { 29 return name; 30 } 31 32 public CtFolder getParent() { 33 return parent; 34 } 35 36 public boolean isFile() { 37 return true; 38 } 39 40 public boolean isJava() { 41 return getName().endsWith(".java"); 42 } 43 44 @Override 45 public String toString() { 46 return getName(); 47 } 48 49 } 50 | Popular Tags |