Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hsqldb.lib.tar
Class DbBackup

    java.lang.Object
      org.hsqldb.lib.tar.DbBackup

    public class DbBackup

extends Object

Works with tar archives containing HSQLDB database instance backups. Viz, creating, examining, or extracting these archives.

This class provides OO Tar backup-creation control. The extraction and listing features are implemented only in static fashion in the Main method, which provides a consistent interface for all three features from the command-line.

For tar creation, the default behavior is to fail if the target archive exists, and to abort if any database change is detected. Use the JavaBean setters to changes this behavior. See the main(String[]) method for details about command-line usage.

Since:
  2.0.0
Author:
  Blaine Simpson (blaine dot simpson at admc dot com), Fred Toussi (fredt@users dot sourceforge.net)
See Also:
  The database backup section of the HyperSQL User Guide, `DbBackupMain.main(String[])`, `setOverWrite(boolean)`, `setAbortUponModify(boolean)`

Constructor Summary
`DbBackup(File archiveFile, String dbPath)` Instantiate a DbBackup instance for creating a Database Instance backup.
`DbBackup(File archiveFile, String dbPath, boolean script)` Used for SCRIPT backup

Method Summary
`boolean` | `getAbortUponModify()`
`boolean` | `getOverWrite()`
`void` | `setAbortUponModify(boolean abortUponModify)` Defaults to true.
`void` | `setFileIgnore(String fileExtension)`
`void` | `setOverWrite(boolean overWrite)` Defaults to false.
`void` | `setStream(String fileExtension, org.hsqldb.lib.InputStreamInterface is)` Overrides file with stream.
`void` | `write()` This method always backs up the .properties and .script files.
`void` | `writeAsFiles()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DbBackup

    public DbBackup(File archiveFile,
                    String dbPath)

  Instantiate a DbBackup instance for creating a Database Instance backup. Much validation is deferred until the write() method, to prevent problems with files changing between the constructor and the write call.

### DbBackup

    public DbBackup(File archiveFile,
                    String dbPath,
                    boolean script)

  Used for SCRIPT backup

Method Detail

### setStream

    public void setStream(String fileExtension,
                          org.hsqldb.lib.InputStreamInterface is)

  Overrides file with stream.

### setFileIgnore

    public void setFileIgnore(String fileExtension)

### setOverWrite

    public void setOverWrite(boolean overWrite)

  Defaults to false. If false, then attempts to write a tar file that already exist will abort.

### setAbortUponModify

    public void setAbortUponModify(boolean abortUponModify)

  Defaults to true. If true, then the write() method will validate that the database is closed, and it will verify that no DB file changes between when we start writing the tar, and when we finish.

### getOverWrite

    public boolean getOverWrite()

### getAbortUponModify

    public boolean getAbortUponModify()

### write

    public void write()
               throws IOException,
                      org.hsqldb.lib.tar.TarMalformatException

  This method always backs up the .properties and .script files. It will back up all of .backup, .data, and .log which exist. If abortUponModify is set, no tar file will be created, and this method will throw.

  Throws:
    `IOException` - for any of many possible I/O problems
    `IllegalStateException` - only if abortUponModify is set, and database is open or is modified.
    `org.hsqldb.lib.tar.TarMalformatException`

### writeAsFiles

    public void writeAsFiles()
                      throws IOException

  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 - 2013 HSQL Development Group.