use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class FileSystemValidator method isFileWritable.
/**
* Method isFileWritable
*
*
* @param filename File path
* @param props Map for name value pairs
* @param state IStateAccess
*
* @return ValidationResult
*
*/
public ValidationResult isFileWritable(String filename, Map props, IStateAccess state) {
ValidationResultStatus validRes = ValidationResultStatus.STATUS_FAILED;
LocalizedMessage returnMessage = null;
if (isStringValid(filename)) {
File file = new File(filename);
if (file.exists() && file.isFile() && file.canWrite()) {
returnMessage = LocalizedMessage.get(LOC_VA_MSG_FILE_READ_WRITE, new Object[] { filename });
validRes = ValidationResultStatus.STATUS_SUCCESS;
}
}
if (validRes.getIntValue() == ValidationResultStatus.INT_STATUS_FAILED) {
returnMessage = LocalizedMessage.get(LOC_VA_WRN_FILE_NOT_READ_WRITE, new Object[] { filename });
}
Debug.log("FileSystemValidator : Is file : " + filename + " writable ? " + validRes.isSuccessful());
return new ValidationResult(validRes, null, returnMessage);
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class FileSystemValidator method isFileReadable.
/**
* Method isFileReadable
*
*
* @param filename File path
* @param props Map for name value pairs
* @param IStateAccess
*
* @return ValidationResult
*
*/
public ValidationResult isFileReadable(String filename, Map props, IStateAccess state) {
ValidationResultStatus validRes = ValidationResultStatus.STATUS_FAILED;
LocalizedMessage returnMessage = null;
if (isStringValid(filename)) {
File file = new File(filename);
if (file.exists() && file.isFile() && file.canRead()) {
returnMessage = LocalizedMessage.get(LOC_VA_MSG_FILE_READ, new Object[] { filename });
validRes = ValidationResultStatus.STATUS_SUCCESS;
}
}
if (validRes.getIntValue() == ValidationResultStatus.INT_STATUS_FAILED) {
returnMessage = LocalizedMessage.get(LOC_VA_WRN_FILE_NOT_READ, new Object[] { filename });
}
Debug.log("FileSystemValidator : Is File : " + filename + " readable ? " + validRes.isSuccessful());
return new ValidationResult(validRes, null, returnMessage);
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class BackupFileTask method getExecutionMessage.
public LocalizedMessage getExecutionMessage(IStateAccess stateAccess, Map properties) {
String fileName = getFileName(stateAccess, properties);
Object[] args = { fileName };
LocalizedMessage message = LocalizedMessage.get(LOC_TSK_MSG_BACKUP_FILE_EXECUTE, args);
return message;
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class InstallDriver method getAgentConfigFilePathMessage.
public LocalizedMessage getAgentConfigFilePathMessage() {
String agentConfigFilePath = (String) getInstallState().getStateAccess().get(STR_CONFIG_AGENT_CONFIG_FILE_PATH_TAG);
Object[] args = { agentConfigFilePath };
LocalizedMessage message = LocalizedMessage.get(LOC_DR_MSG_PRODUCT_AGENT_CONFIG_FILE_NAME, args);
return message;
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class InstallDriver method displayAndLogInstallSummary.
public void displayAndLogInstallSummary(InstallLogger installLog) {
ArrayList messageList = new ArrayList();
messageList.add(getSummaryInfoHeaderMessage());
messageList.add(getSummaryInfoHeaderMessageFmtLine());
messageList.add(getProductInstanceNameMessage());
messageList.add(getProductConfigFilePathMessage());
messageList.add(getAgentConfigFilePathMessage());
messageList.add(getProductAuditLogsPathMessage());
messageList.add(getProductDebugLogsPathMessage());
int count = messageList.size();
printConsoleEmptyLine();
printConsoleEmptyLine();
installLog.getLogger().logEmptyLine();
for (int i = 0; i < count; i++) {
LocalizedMessage message = (LocalizedMessage) messageList.get(i);
printConsoleMessage(message);
installLog.getLogger().log(message);
}
}
Aggregations