public class RotateFileAction extends java.lang.Object implements CloseAction
Constructor and Description |
---|
RotateFileAction(java.io.File sourceFile,
java.io.File targetFile)
Create the rotate action.
|
Modifier and Type | Method and Description |
---|---|
void |
run()
This function is executed after the wrapped
OutputStream of
an OutputStreamWithCloseAction has been successfully closed. |
public RotateFileAction(java.io.File sourceFile, java.io.File targetFile) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
sourceFile
- File to rotate.targetFile
- File into which sourceFile must be renamed.java.lang.NullPointerException
- If any of the given file is missing.java.lang.IllegalArgumentException
- If the source file does not exist,
or if it is not a regular file,
or if the target file exists but is not
a regular file.public void run() throws java.io.IOException
CloseAction
OutputStream
of
an OutputStreamWithCloseAction
has been successfully closed.run
in interface CloseAction
java.io.IOException
- If any error prevents this CloseAction
to
run.