at.gv.egiz.pdfas.utils
Class ConfigUtils

java.lang.Object
  extended byat.gv.egiz.pdfas.utils.ConfigUtils

public final class ConfigUtils
extends Object

Author:
Thomas Knall

Method Summary
static String assertFileSeparator(String path)
           
static String deployDefaultConfiguration()
          Deploys the default configuration to the user's home directory to the subdirectory specified by Constants.Constants.USERHOME_CONFIG_FOLDER.
static String deployDefaultConfiguration(boolean overwriteExisting)
          Deploys the default configuration to the user's home directory to the subdirectory specified by Constants.Constants.USERHOME_CONFIG_FOLDER.
static String deployDefaultConfiguration(String destination, boolean overwriteExisting)
          Deploys the default configuration to the given destination folder.
static void initializeLogger()
           
static void printConfigInfo()
           
static void printConfigInfo(org.apache.commons.logging.Log logger)
           
static boolean toFile(InputStream inputStream, File file)
           
static void writeInputStreamToOutputStream(InputStream inputStream, OutputStream outputStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

deployDefaultConfiguration

public static String deployDefaultConfiguration(String destination,
                                                boolean overwriteExisting)
                                         throws ConfigUtilsException
Deploys the default configuration to the given destination folder.

Parameters:
destination - The destination folder.
overwriteExisting - If set true an already existing configuration is overwritten. If false nothing is being copied if the destination folder already exists.
Returns:
The folder the configuration has been extracted to or null if the configuration has NOT been deployed.
Throws:
ConfigUtilsException - Thrown if there was an error during the deployment of the configuration.

deployDefaultConfiguration

public static String deployDefaultConfiguration(boolean overwriteExisting)
                                         throws ConfigUtilsException
Deploys the default configuration to the user's home directory to the subdirectory specified by Constants.Constants.USERHOME_CONFIG_FOLDER.

Parameters:
overwriteExisting - If set true an already existing configuration is overwritten. If false nothing is being copied if the destination folder already exists.
Returns:
The folder the configuration has been extracted to or null if the configuration has NOT been deployed.
Throws:
ConfigUtilsException - Thrown if there was an error during the deployment of the configuration.
See Also:
Constants.USERHOME_CONFIG_FOLDER

deployDefaultConfiguration

public static String deployDefaultConfiguration()
                                         throws ConfigUtilsException
Deploys the default configuration to the user's home directory to the subdirectory specified by Constants.Constants.USERHOME_CONFIG_FOLDER.

Returns:
The folder the configuration has been extracted to or null if the configuration has NOT been deployed.
Throws:
ConfigUtilsException - Thrown if there was an error during the deployment of the configuration.
See Also:
Constants.USERHOME_CONFIG_FOLDER

toFile

public static boolean toFile(InputStream inputStream,
                             File file)
                      throws IOException
Throws:
IOException

writeInputStreamToOutputStream

public static void writeInputStreamToOutputStream(InputStream inputStream,
                                                  OutputStream outputStream)
                                           throws IOException
Throws:
IOException

assertFileSeparator

public static String assertFileSeparator(String path)

initializeLogger

public static void initializeLogger()

printConfigInfo

public static void printConfigInfo(org.apache.commons.logging.Log logger)

printConfigInfo

public static void printConfigInfo()


Copyright © 2006-2010. All Rights Reserved.