jmri.jmrit.operations.setup
Class Backup

java.lang.Object
  extended by jmri.jmrit.XmlFile
      extended by jmri.jmrit.operations.setup.Backup

public class Backup
extends XmlFile

Backs up operation files. Creates the "backups" and date directories along with backup files in the operations directory.

Author:
Daniel Boudreau Copyright (C) 2008

Field Summary
 
Fields inherited from class jmri.jmrit.XmlFile
dtdLocation, xsltLocation
 
Constructor Summary
Backup()
           
 
Method Summary
 boolean backupFiles(File directory)
          Creates backup files for the directory specified
 boolean backupFiles(String directoryName)
          Creates a folder named directoryName in the backups folder, and then saves all of the operations files into that folder.
 boolean checkDirectoryExists(String directoryName)
          Check to see if a backup operations directory already exists
 String createBackupDirectoryName()
           
 String getBackupDirectoryName()
           
 String[] getBackupList()
           
 String getDirectoryName()
           
 boolean loadDemoFiles()
           
 void reset()
          Reset operations by deleting xml files, leaves directories and backup files in place
 boolean restore(File directory)
          Copies operation files from directoryName
 boolean restore(String directoryName)
           
 boolean restore(String directoryPath, String directoryName)
           
 void setDirectoryName(String name)
           
 
Methods inherited from class jmri.jmrit.XmlFile
addDefaultInfo, backupFileName, checkFile, createFileNameWithDate, dumpElement, ensurePrefsPresent, findFile, getBuilder, getRootViaURI, getVerify, makeBackupFile, makeBackupFile, newDocument, newDocument, prefsDir, reportError1, reportError2, resourcesDir, revertBackupFile, rootFromFile, rootFromName, rootFromURL, scriptsDir, setScriptsFileLocationDefault, setUserFileLocationDefault, setVerify, userFileChooser, userFileChooser, userFileChooser, userFileChooser, userFileLocationDefault, writeXML, xmlDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Backup

public Backup()
Method Detail

backupFiles

public boolean backupFiles(String directoryName)
Creates a folder named directoryName in the backups folder, and then saves all of the operations files into that folder.

Parameters:
directoryName -
Returns:
true if successful, false if not.

backupFiles

public boolean backupFiles(File directory)
Creates backup files for the directory specified

Parameters:
directory - The directory to use for the backup.
Returns:
true if successful.

getBackupList

public String[] getBackupList()

checkDirectoryExists

public boolean checkDirectoryExists(String directoryName)
Check to see if a backup operations directory already exists

Parameters:
directoryName -
Returns:
true if it exists

restore

public boolean restore(String directoryName)

restore

public boolean restore(String directoryPath,
                       String directoryName)

restore

public boolean restore(File directory)
Copies operation files from directoryName

Parameters:
directory -
Returns:
true if successful, false if not.

loadDemoFiles

public boolean loadDemoFiles()

getDirectoryName

public String getDirectoryName()

setDirectoryName

public void setDirectoryName(String name)

getBackupDirectoryName

public String getBackupDirectoryName()

createBackupDirectoryName

public String createBackupDirectoryName()

reset

public void reset()
Reset operations by deleting xml files, leaves directories and backup files in place



Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads