processCertificatePasswords
Reads password triplets or doublets from passwordFile and sets them in CommonInfoModel
format: domain_name instance_name password
or: domain_name password
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(pwdfile)));
while(reader.ready()){
String entry = reader.readLine();
StringTokenizer tokens = new StringTokenizer(entry, " ", false);
int tokenCount = tokens.countTokens();
if (tokenCount < 1){
_logger.severe(sm.getString("enterprise.tools.upgrade.cli.password_missing",pwdfile));
System.exit(1);
}
if (tokenCount > 1) {
String domainName = tokens.nextToken();
commonInfo.setCurrentDomain(domainName);
commonInfo.addDomainOptionName(domainName);
}
if (tokenCount == 3) {
commonInfo.setCurrentSourceInstance(tokens.nextToken());
}
setCertificatePassword(tokens.nextToken());
if(commonInfo.getSourceVersion().equals(UpgradeConstants.VERSION_7X)) {
interactiveMap.put(ArgsParser.DOMAIN + "-" + commonInfo.getCurrentDomain() + ":" + commonInfo.getCurrentSourceInstance(), pwdfile);
} else interactiveMap.put(ArgsParser.DOMAIN + "-" + commonInfo.getCurrentDomain(), pwdfile);
}
} catch(FileNotFoundException fe) {
helpUsage();
_logger.log(Level.SEVERE,sm.getString("enterprise.tools.upgrade.cli.password_file_missing",pwdfile),fe);
System.exit(1);
} catch(Exception io) {
_logger.log(Level.SEVERE,sm.getString("enterprise.tools.upgrade.cli.password_missing",pwdfile),io);
System.exit(1);
}