db
Class OdbHsqldbBridge

java.lang.Object
  extended by db.OdbHsqldbBridge

public final class OdbHsqldbBridge
extends Object


Field Summary
static String DBNAME
           
static String DIRECTORY_DB_OO
           
static String HSQLDB_OPTIONS
           
static Logger LOGGER
           
static String ODB_PATTERN
           
 
Method Summary
protected static void compressDatabase(File databaseDir, String databaseName, ZipOutputStream odbStream)
           
static void copy(InputStream inStream, OutputStream outStream)
           
static void exportDatabase(InputStream odbStream, File databaseDir, String databaseName, File odbOutput)
          Export the database in directory in a new odbfile which is created using the pattern argument.
static InputStream getDefaultOdbPattern(Object o)
           
static String makeEmbeddedURL(File dbDir, String dbName)
           
static String makeLocalhostURL(String dbName)
           
static String makeNetworkURL(String host, int port, String dbName)
          The host name or adress should begin with /.
static String makeNetworkURL(String host, String dbName)
          The host name or adress should begin with /.
protected static void transferOdbPattern(ZipInputStream inStream, ZipOutputStream outStream)
          Transfer only the files associated with the database in odb format.
static void uncompressDatabase(InputStream odbStream, File databaseDir, String databaseName)
          Uncompress the database contained in a odb pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTORY_DB_OO

public static final String DIRECTORY_DB_OO
See Also:
Constant Field Values

DBNAME

public static final String DBNAME
See Also:
Constant Field Values

ODB_PATTERN

public static final String ODB_PATTERN
See Also:
Constant Field Values

LOGGER

public static final Logger LOGGER

HSQLDB_OPTIONS

public static final String HSQLDB_OPTIONS
See Also:
Constant Field Values
Method Detail

getDefaultOdbPattern

public static InputStream getDefaultOdbPattern(Object o)

copy

public static void copy(InputStream inStream,
                        OutputStream outStream)
                 throws IOException
Throws:
IOException

uncompressDatabase

public static void uncompressDatabase(InputStream odbStream,
                                      File databaseDir,
                                      String databaseName)
                               throws FileNotFoundException,
                                      IOException
Uncompress the database contained in a odb pattern.

Parameters:
odbStream - the odb pattern
databaseDir - the extraction directory
databaseName - the name of the extracted database.
Throws:
IOException
FileNotFoundException

compressDatabase

protected static void compressDatabase(File databaseDir,
                                       String databaseName,
                                       ZipOutputStream odbStream)
                                throws IOException
Throws:
IOException

transferOdbPattern

protected static void transferOdbPattern(ZipInputStream inStream,
                                         ZipOutputStream outStream)
                                  throws IOException
Transfer only the files associated with the database in odb format.

Parameters:
inStream - the source (pattern)
outStream - the destination
buffer - a reusable buffer
Throws:
IOException

exportDatabase

public static void exportDatabase(InputStream odbStream,
                                  File databaseDir,
                                  String databaseName,
                                  File odbOutput)
                           throws IOException
Export the database in directory in a new odbfile which is created using the pattern argument.

Parameters:
odbStream - pattern
databaseDir - exported database directory
databaseName -
odbOutput - new odbfile
Throws:
IOException

makeLocalhostURL

public static final String makeLocalhostURL(String dbName)

makeEmbeddedURL

public static final String makeEmbeddedURL(File dbDir,
                                           String dbName)

makeNetworkURL

public static final String makeNetworkURL(String host,
                                          String dbName)
The host name or adress should begin with /.


makeNetworkURL

public static final String makeNetworkURL(String host,
                                          int port,
                                          String dbName)
The host name or adress should begin with /.



Copyright © 2012. All Rights Reserved.