Package org.forgerock.opendj.setup.model
Class TempLogFile
java.lang.Object
org.forgerock.opendj.setup.model.TempLogFile
This class represents a temporary log file which should be usually deleted if linked operation succeeded.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the log file handler and delete the temp log file .Gets the name of the log file.getPath()Return the absolute path of the temp log file.booleanReturntrueif a temp log file has been created and could be used to log messages.static TempLogFilenewTempLogFile(String prefix) Creates a new temporary log file.
-
Method Details
-
newTempLogFile
Creates a new temporary log file.Log file will be generated in the OS temporary directory and its name will have the following pattern: prefix-[RANDOM_NUMBER_STRING].log
- Parameters:
prefix- log file prefix to which log messages will be written.- Returns:
- a new temporary log file.
-
getLogFile
Gets the name of the log file.- Returns:
- File representing the log file
-
deleteLogFileAfterSuccess
public void deleteLogFileAfterSuccess()Closes the log file handler and delete the temp log file . -
isEnabled
public boolean isEnabled()Returntrueif a temp log file has been created and could be used to log messages.- Returns:
trueif a temp log file has been created and could be used to log messages.
-
getPath
Return the absolute path of the temp log file.- Returns:
- the absolute path of the temp log file.
-