01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: package com.sun.portal.harness;
07:
08: import java.io.FileInputStream;
09:
10: import java.util.Properties;
11:
12: public class PackagerProps {
13:
14: private PackagerProps(String chname, String configdir,
15: String compfile) throws ProviderHarnessException {
16: try {
17: m_DTProps = new Properties();
18: m_DTProps.load(new FileInputStream(configdir
19: + "/desktop/desktopconfig.properties"));
20: } catch (Exception ex) {
21: throw new ProviderHarnessException(
22: "Exception loading desktop properties.", ex);
23: }
24: m_Props = HarnessProperties.makeHarnessProperties(
25: UsersFile.DEFAULT_USER, configdir + "/Users.xml",
26: compfile, null, null);
27: m_ChannelName = chname;
28: }
29:
30: public static PackagerProps makePackagerProps(String chname,
31: String configdir, String compfile)
32: throws ProviderHarnessException {
33: return new PackagerProps(chname, configdir, compfile);
34: }
35:
36: public String getPBFProperty(String name)
37: throws ProviderHarnessException {
38: String val = m_DTProps.getProperty(name);
39: if (val != null) {
40: return val;
41: }
42: try {
43: return m_Props.getStringProperty(m_ChannelName, name);
44: } catch (Error err) {
45: throw new ProviderHarnessException("Property \"" + name
46: + "\" is undefined.");
47: }
48: }
49:
50: private Properties m_DTProps = null;
51: private HarnessProperties m_Props;
52: private String m_ChannelName;
53: }
|