Class MetisSafeFileManager
java.lang.Object
io.github.tonywasher.joceanus.metis.toolkit.MetisSafeFileManager
Safe File Create.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCleanup file.static voidclearDirectory(File pDirectory) ClearUp directory.voidCommit file.Obtain name of temporary file to write to.Obtain standard name.voidsetNumBackups(int pNumBackups) Set the number of backups.
-
Field Details
-
TEMP_EXT
The temp extension.- See Also:
-
COMMIT_EXT
The commit extension.- See Also:
-
COMMITX_EXT
The commit extension.- See Also:
-
CHAR_DOT
static final char CHAR_DOTThe dot character.- See Also:
-
-
Constructor Details
-
MetisSafeFileManager
Constructor.- Parameters:
pFileName- the file name
-
-
Method Details
-
setNumBackups
public void setNumBackups(int pNumBackups) Set the number of backups.- Parameters:
pNumBackups- the number of backups
-
commitFile
Commit file.- Throws:
OceanusException- on error
-
cleanUpFile
public void cleanUpFile()Cleanup file. -
getFileToWriteTo
Obtain name of temporary file to write to.- Returns:
- the temporary name
-
getRealFile
Obtain standard name.- Returns:
- the standard name
-
clearDirectory
ClearUp directory.- Parameters:
pDirectory- the directory to clean
-