try {
String mappingFile = ctx.getRealPath(MAPPING_FILE);
String hibernateProps = ctx.getRealPath(HIBERNATE_PROPERTIES);
this.pm = new PersistenceManager(mappingFile, hibernateProps);
} catch (Exception e) {
throw new PortletServiceUnavailableException(e);
}
String configCredentialToFile =
config.getInitParameter("SaveCredentialsToFile");
log.debug("configCredentialToFile = " + configCredentialToFile);
if (configCredentialToFile == null ||
configCredentialToFile.equals("") ||
configCredentialToFile.equalsIgnoreCase("false") ||
configCredentialToFile.equalsIgnoreCase("no")) {
log.info("Credentials will not be saved to files");
return;
}
saveCredentialsToFile = true;
String configCredentialDir =
config.getInitParameter("ActiveCredentialDir");
if (configCredentialDir == null || configCredentialDir.equals("")) {
try {
File tempFile = File.createTempFile("temp", "temp");
activeCredentialDir = tempFile.getParent();
} catch (IOException e) {
throw new PortletServiceUnavailableException(e.getMessage());
}
} else {
activeCredentialDir = configCredentialDir;
}
if ( ! activeCredentialDir.endsWith(File.separator)) {