1 23 24 package com.sun.enterprise.deployment.deploy.shared; 25 26 import java.io.OutputStream ; 27 import java.io.InputStream ; 28 import java.io.IOException ; 29 import java.util.Enumeration ; 30 import java.util.jar.Manifest ; 31 import java.util.Vector ; 32 33 import com.sun.enterprise.deployment.deploy.shared.WritableArchive; 34 import com.sun.enterprise.deployment.deploy.shared.Archive; 35 36 42 public abstract class AbstractArchive implements WritableArchive { 43 44 47 public abstract String getArchiveUri(); 48 49 52 public abstract long getArchiveSize() throws NullPointerException , SecurityException ; 53 54 59 public abstract Enumeration entries(Enumeration embeddedArchives); 60 61 64 public abstract boolean exists(); 65 66 69 public abstract boolean delete(); 70 71 76 public abstract boolean renameTo(String name); 77 78 81 public boolean supportsElementsOverwriting() { 82 return false; 83 } 84 85 88 public Archive getSubArchive(String name) throws IOException { 89 return getEmbeddedArchive(name); 90 } 91 92 95 public abstract void closeEntry(AbstractArchive sub) throws IOException ; 96 97 public abstract AbstractArchive getEmbeddedArchive(String name) 98 throws IOException ; 99 100 109 public Enumeration entries(String prefix) { 110 Enumeration allEntries = entries(); 111 Vector entries = new Vector (); 112 while (allEntries.hasMoreElements()) { 113 String name = (String ) allEntries.nextElement(); 114 if (name != null && name.startsWith(prefix)) { 115 entries.add(name); 116 } 117 } 118 return entries.elements(); 119 } 120 } 121 | Popular Tags |