org.fuin.kickstart4j
Class ConfigUpdater

java.lang.Object
  extended by org.fuin.kickstart4j.ConfigUpdater

public final class ConfigUpdater
extends java.lang.Object

Creates or updates a configuration.


Constructor Summary
ConfigUpdater()
          Default constructor.
ConfigUpdater(ConfigUpdaterListener listener)
          Constructor with listener.
ConfigUpdater(java.io.File configFile)
          Constructor with configuration file.
ConfigUpdater(java.io.File configFile, ConfigUpdaterListener listener)
          Constructor with configuration file and log printer.
 
Method Summary
 Config getConfig()
          Returns the configuration.
 ConfigUpdaterListener getListener()
          Returns the listener to inform about progress.
static void main(java.lang.String[] args)
          Creates a new configuration file or updates an existing one.
 void update(java.io.File baseDir)
          Clears the source file list in the configuration (!)
 void update(java.util.List remoteFileList)
          Clears the source file list in the configuration (!)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigUpdater

public ConfigUpdater()
Default constructor.


ConfigUpdater

public ConfigUpdater(ConfigUpdaterListener listener)
Constructor with listener.

Parameters:
listener - Used for writing log messages - Cannot be null.

ConfigUpdater

public ConfigUpdater(java.io.File configFile)
              throws InvalidConfigException
Constructor with configuration file.

Parameters:
configFile - Existing configuration file.
Throws:
InvalidConfigException - Error parsing an existing configuration.

ConfigUpdater

public ConfigUpdater(java.io.File configFile,
                     ConfigUpdaterListener listener)
              throws InvalidConfigException
Constructor with configuration file and log printer.

Parameters:
configFile - Existing configuration file.
listener - Used for writing log messages.
Throws:
InvalidConfigException - Error parsing an existing configuration.
Method Detail

update

public final void update(java.util.List remoteFileList)
                  throws java.io.IOException
Clears the source file list in the configuration (!) and adds the remote files in the list. Informations (like "unzip", "loadAlways" or "addToClasspath") of known source files will be preserved.

Parameters:
remoteFileList - List with RemoteFile objects.
Throws:
java.io.IOException - Error while copying.

update

public final void update(java.io.File baseDir)
                  throws java.io.IOException
Clears the source file list in the configuration (!) and adds all files in the directory (and it's sub directories). Informations (like "unzip", "loadAlways" or "addToClasspath") of known source files will be preserved.

Parameters:
baseDir - Source directory to create a configuration for.
Throws:
java.io.IOException - Error while copying.

getConfig

public final Config getConfig()
Returns the configuration.

Returns:
Configuration.

getListener

public final ConfigUpdaterListener getListener()
Returns the listener to inform about progress.

Returns:
Listener - Always non-null.

main

public static void main(java.lang.String[] args)
                 throws InvalidConfigException,
                        java.io.IOException
Creates a new configuration file or updates an existing one.

Parameters:
args - First argument is the path and name of the configuration file. Second argument is the directory to create the configuration for.
Throws:
InvalidConfigException - Error parsing an existing configuration file.
java.io.IOException - I/O-Error.


Copyright © 2009 Future Invent Informationsmanagement GmbH. All Rights Reserved.