Methods Summary |
---|
private static synchronized java.lang.String | get(java.lang.String key)
final String password = (String)entries.get(key);
if (password == null)
{
throw new IOException("No entry found for " + key);
}
return password;
|
private static java.lang.String | getDefaultPasswordConf()
String defaultConf = null;
if (INSTANCE_ROOT != null)
{
defaultConf = INSTANCE_ROOT + File.separator
+ File.separator + CONFIG + File.separator
+ PASSWORD_CONF;
}
return defaultConf;
|
public static java.lang.String | getKeyStorePassword()
return getPassword(KEY_STORE_ALIAS);
|
public static java.lang.String | getPassword(java.lang.String alias)
if (!isInSync()) { sync(); }
return get(alias);
|
private static com.sun.enterprise.admin.common.PasswordConfReader$PasswordFile | getPasswordFile()
final String prop = System.getProperty(PASSWORD_FILE_PROPERTY);
PasswordFile f;
if ((prop != null) && (prop.length() > 0))
{
f = new PasswordFile(prop);
}
else
{
f = new PasswordFile(getDefaultPasswordConf());
}
return f;
|
public static java.lang.String | getTrustStorePassword()
return getPassword(TRUST_STORE_ALIAS);
|
private static boolean | isInSync()
return getPasswordFile().equals(pf);
|
public static java.util.Enumeration | listAliases()
if (!isInSync()) { sync(); }
return entries.keys();
|
private static synchronized void | loadEntries()
if (entries == null)
{
entries = new Hashtable();
}
BufferedReader reader = null;
try
{
reader = new BufferedReader(new FileReader(pf.getPath()));
String str;
while ((str = reader.readLine()) != null)
{
int index = str.indexOf(':");
if (index > 0)
{
entries.put(str.substring(0, index),
str.substring(index+1));
}
}
}
finally
{
if (reader != null) { reader.close(); }
}
|
private static void | sync()
synchronized (PasswordConfReader.class)
{
pf = getPasswordFile();
}
loadEntries();
|