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 TypeMethodDescriptionvoid
Closes 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.boolean
Returntrue
if a temp log file has been created and could be used to log messages.static TempLogFile
newTempLogFile
(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()Returntrue
if a temp log file has been created and could be used to log messages.- Returns:
true
if 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.
-