01: /*
02: * PPFAuxFile.java
03: *
04: * Created on October 25, 2001, 3:05 PM
05: */
06:
07: package com.sun.portal.desktop.deployment;
08:
09: import java.io.FileInputStream;
10: import java.io.InputStream;
11: import java.io.File;
12:
13: import java.util.zip.ZipEntry;
14:
15: /**
16: * ProviderPackageFile for encapsulating a class - common logic
17: * for handling class & package name for files extracted from directories
18: * or jars. The only thing that's different for these two cases is
19: * actually streaming the output, which is defined in subclasses.
20: *
21: * @author yabob
22: * @version
23: */
24: public abstract class ClassPPF extends ProviderPackageFile {
25:
26: public ClassPPF(String pkg, String classname, int types) {
27: super (types);
28:
29: m_ClassName = classname;
30: m_Pkg = pkg;
31: }
32:
33: public ClassPPF(String fullname, int types) {
34: super (types);
35:
36: int i = fullname.lastIndexOf(".");
37: if (i > 0) {
38: m_ClassName = fullname.substring(i + 1);
39: m_Pkg = fullname.substring(0, i);
40: } else {
41: m_ClassName = fullname;
42: m_Pkg = "";
43: }
44: }
45:
46: public void addManifestInclusion(ParManifest man, String name)
47: throws ParFileException {
48: man.addDPEntryIncludeClass(name, m_Pkg, m_ClassName, m_Types);
49: }
50:
51: public ZipEntry getZipEntry(ParManifest man)
52: throws ParFileException {
53: return man.getClassZip(m_Pkg, m_ClassName);
54: }
55:
56: // we additionally define class existance logic at this level to encapsulate logic for
57: // class lookups.
58:
59: public abstract boolean classExists();
60:
61: protected String m_ClassName;
62: protected String m_Pkg;
63: }
|