org.liquidsite.app.install
Class Installer

java.lang.Object
  extended byorg.liquidsite.app.install.Installer

public class Installer
extends java.lang.Object

The install helper class. This class handles all the installation tasks, such as database updates and configuration writing.


Constructor Summary
Installer(java.lang.String version, DatabaseConnector connector, java.io.File sqlDir)
          Create a new installer.
 
Method Summary
 boolean canUpdate(java.lang.String fromVersion)
          Checks if the specified Liquid Site version can be updated by this installer.
 void createTables(java.lang.String database)
          Creates the Liquid Site database tables.
 java.io.File getSqlDir()
          Returns the SQL file directory.
 void updateTables(java.lang.String database, java.lang.String fromVersion)
          Updates the Liquid Site database tables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Installer

public Installer(java.lang.String version,
                 DatabaseConnector connector,
                 java.io.File sqlDir)
Create a new installer.

Parameters:
version - the application version to install
connector - the database connector to use
sqlDir - the base directory for the SQL files
Method Detail

canUpdate

public boolean canUpdate(java.lang.String fromVersion)
Checks if the specified Liquid Site version can be updated by this installer.

Parameters:
fromVersion - the version to update from
Returns:
true if the installer supports the update, or false otherwise

getSqlDir

public java.io.File getSqlDir()
Returns the SQL file directory.

Returns:
the SQL file directory

createTables

public void createTables(java.lang.String database)
                  throws InstallException
Creates the Liquid Site database tables. The database must already exist for this method to work.

Parameters:
database - the database name
Throws:
InstallException - if the database tables couldn't be created correctly

updateTables

public void updateTables(java.lang.String database,
                         java.lang.String fromVersion)
                  throws InstallException
Updates the Liquid Site database tables. The database must already contain the specified Liquid Site version for this method to work.

Parameters:
database - the database name
fromVersion - the database Liquid Site version
Throws:
InstallException - if the database tables couldn't be updated correctly