Class StoreFileMover
java.lang.Object
org.apache.catalina.storeconfig.StoreFileMover
Move server.xml or context.xml as backup
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringManagerThe string manager for this package. -
Constructor Summary
ConstructorsConstructorDescriptionStoreFileMover(String basename, String filename, String encoding) Calculate file objects for the old and new configuration files. -
Method Summary
Modifier and TypeMethodDescriptionReturns the base directory path for configuration files.Returns the File object representing the new configuration file.Returns the File object representing the old configuration file.Returns the File object representing the saved backup configuration file.Returns the character encoding used for configuration files.Returns the configuration file name.protected StringTime value for backup yyyy-mm-dd.hh-mm-ss.Open an output writer for the new configuration file.voidinit()Generate the Filename to new with TimeStamp.voidmove()Shuffle old->save and new->old.voidsetBasename(String basename) Sets the base directory path for configuration files.voidsetEncoding(String string) Sets the character encoding used for configuration files.voidsetFilename(String string) Sets the configuration file name.
-
Field Details
-
sm
The string manager for this package.
-
-
Constructor Details
-
StoreFileMover
-
-
Method Details
-
getConfigNew
Returns the File object representing the new configuration file.- Returns:
- the new configuration file
-
getConfigOld
Returns the File object representing the old configuration file.- Returns:
- the old configuration file
-
getConfigSave
Returns the File object representing the saved backup configuration file.- Returns:
- the backup configuration file
-
getBasename
Returns the base directory path for configuration files.- Returns:
- the base directory path
-
setBasename
Sets the base directory path for configuration files.- Parameters:
basename- the base directory path
-
getFilename
Returns the configuration file name.- Returns:
- the configuration file name
-
setFilename
Sets the configuration file name.- Parameters:
string- the configuration file name
-
getEncoding
Returns the character encoding used for configuration files.- Returns:
- the character encoding
-
setEncoding
Sets the character encoding used for configuration files.- Parameters:
string- the character encoding
-
init
public void init()Generate the Filename to new with TimeStamp. -
move
Shuffle old->save and new->old.- Throws:
IOException- a file operation error occurred
-
getWriter
Open an output writer for the new configuration file.- Returns:
- The writer
- Throws:
IOException- Failed opening a writer to the new file
-
getTimeTag
-