01: /*
02: * ClassStream.java
03: *
04: * Created on May 7, 2002, 10:31 AM
05: */
06:
07: package com.sun.portal.desktop.deployment;
08:
09: import java.io.InputStream;
10:
11: /**
12: *
13: * @author yabob
14: * @version
15: */
16: public class ClassLoaderPPF extends ClassPPF {
17:
18: public ClassLoaderPPF(String classname, int types) {
19: super (classname, types);
20: }
21:
22: public InputStream getStream() throws ParFileException {
23: if (m_Strm == null && !classExists()) {
24: Object tok[] = { m_ClassName };
25: throw new ParFileException("errorNoClass", tok);
26: }
27:
28: return m_Strm;
29: }
30:
31: public boolean classExists() {
32:
33: String cfile = Par.classToFile(m_ClassName);
34: cfile = m_Pkg.replace('.', '/') + "/" + cfile;
35: m_Strm = getClass().getClassLoader().getResourceAsStream(cfile);
36: return m_Strm != null;
37: }
38:
39: private InputStream m_Strm;
40: }
|