OpenNMS API 1.2.3

org.opennms.web.parsers
Class FileBackup

java.lang.Object
  extended byorg.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
 
Constructor Summary
FileBackup()
           
 
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
 

Field Detail

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
Constructor Detail

FileBackup

public FileBackup()
Method Detail

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 file
fileName - the name to give the backup
Throws:
XMLWriteException - if the backup was not able to be made
java.io.IOException

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.