Package org.forgerock.opendj.setup.model
Class TempLogFile
- java.lang.Object
-
- org.forgerock.opendj.setup.model.TempLogFile
-
public final class TempLogFile extends Object
This class represents a temporary log file which should be usually deleted if linked operation succeeded.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteLogFileAfterSuccess()
Closes the log file handler and delete the temp log file .File
getLogFile()
Gets the name of the log file.String
getPath()
Return the absolute path of the temp log file.boolean
isEnabled()
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 Detail
-
newTempLogFile
public static TempLogFile newTempLogFile(String prefix)
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
public 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
public String getPath()
Return the absolute path of the temp log file.- Returns:
- the absolute path of the temp log file.
-
-