org.opennms.web.parsers
Class FileBackup
java.lang.Object
org.opennms.web.parsers.FileBackup
- public class FileBackup
- extends java.lang.Object
This class makes a backup of an xml file. The backup should be made before
any new configuration xml is saved. The class will try to determine what
directory to backup to based on properties in the bluebird property file.
Failing this, a default will be used that is the current directory where the
call was made from. A default ".backup" extension will be placed on this
file.
Field Summary |
static java.lang.String |
BACKUP_DIR_PROP
The property string to look for in bluebird property file for the backup
directory |
Method Summary |
static void |
makeBackup(java.lang.String original,
java.lang.String fileName)
This method attempts to make a backup of an xml file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BACKUP_DIR_PROP
public static final java.lang.String BACKUP_DIR_PROP
- The property string to look for in bluebird property file for the backup
directory
- See Also:
- Constant Field Values
FileBackup
public FileBackup()
makeBackup
public static void makeBackup(java.lang.String original,
java.lang.String fileName)
throws java.io.IOException
- This method attempts to make a backup of an xml file. The first parameter
should be the full path to the original file at least relative to where
the method is running from, or the absolute path to the file. The second
parameter is the just the file name that will identify the backup. A
default extension will be added to this filename.
- Parameters:
original
- a path and file name to the original filefileName
- the name to give the backup
- Throws:
XMLWriteException
- if the backup was not able to be made
java.io.IOException
Generated by eevans on May 29 2005 2015.