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 file extracted from a
17: * directory.
18: *
19: * @author yabob
20: * @version
21: */
22: public class ClassFilePPF extends ClassPPF {
23:
24: public ClassFilePPF(String pkg, String classname, String classroot,
25: int types) {
26: super (pkg, classname, types);
27: m_CRoot = classroot;
28: }
29:
30: public ClassFilePPF(String fullname, String classroot, int types) {
31: super (fullname, types);
32: m_CRoot = classroot;
33: }
34:
35: public InputStream getStream() throws ParFileException {
36:
37: try {
38: String cf = Par.classToFile(m_Pkg, m_ClassName);
39: return new FileInputStream(new File(m_CRoot + FS + cf));
40: } catch (Exception ex) {
41: throw new ParFileException("errorClassOpen", ex);
42: }
43: }
44:
45: public boolean classExists() {
46: String cf = Par.classToFile(m_Pkg, m_ClassName);
47: File f = new File(m_CRoot + FS + cf);
48: return f.isFile();
49: }
50:
51: private String m_CRoot;
52: }
|