net.sourceforge.jdbdump.dump
Class PlainTextFileManager
java.lang.Object
net.sourceforge.jdbdump.dump.PlainTextFileManager
- All Implemented Interfaces:
- DumpFileManager
public class PlainTextFileManager
- extends java.lang.Object
- implements DumpFileManager
An implementation of DumpFileManager which saves dump objects in plain text form as SQL commands.
- Author:
- jsuder
- See Also:
DumpFileManager
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PlainTextFileManager
public PlainTextFileManager()
exportDump
public void exportDump(Dump dump,
java.io.File file,
DumpFileManager.CompressionMethod compress)
- Saves a backup of the database represented in the dump object into the specified file.
First it saves the database structure which is already contained in the Dump, then
uses the Dump to download all the data, table by table, record by record, and saves it
into the file as soon as it's downloaded.
- Specified by:
exportDump
in interface DumpFileManager
- Parameters:
dump
- a database dump created using DatabaseConnector.dump() methodfile
- a file in which the backup will be storedcompress
- compression method used to compress the file (zip, gzip or none)
importDump
public Dump importDump(java.io.File file,
DumpFileManager.CompressionMethod compress)
- Loads the database structure as a Dump object from the specified file.
This method doesn't load any data (i.e. table records) from the file yet. Data should be
loaded by DatabaseConnector.restore() when the dump returned by this function is passed to
it. The dump stores a reference to the input stream from this file to be able to read the data
later; when it is no longer needed, it should be closed by calling closeFileReader() on the
Dump (but that shouldn't be called until all data is read in DatabaseConnector.restore()).
- Specified by:
importDump
in interface DumpFileManager
- Parameters:
file
- a file from which the backup should be readcompress
- compression method used to decompress the file (zip, gzip or none)
- Returns:
- a database dump that can be uploaded using DatabaseConnector.restore() method
Copyright © 2005-2006 AGH International University of Science and Technology. All Rights Reserved.