com.sibvisions.rad.server.config
Class Configuration

java.lang.Object
  extended by com.sibvisions.rad.server.config.Configuration

public final class Configuration
extends java.lang.Object

The Configuration enables the access to the server zone and all available application zones. The zones are organized in following directories:

 <CONFIG-DIRECTORY>
 |- apps                   (applications directory)
    |- <application name>  (application zone) (application directory - case sensitive)
       |- src              (source files)
       |- libs             (additional libraries)
       |- classes          (compiled sources)
       |- config.xml       (application configuration file)
 |- server                 (server zone) (server directory)
    |- config.xml          (server configuration file)
 


Nested Class Summary
static class Configuration.ApplicationListOption
          Application name restriction.
 
Method Summary
static void clearCache()
          Clears the zone cache.
static java.io.File getApplicationsDir()
          Returns the directory with the applications.
static ApplicationZone getApplicationZone(java.lang.String pApplicationName)
          Returns the current zone for an application.
static AppSettings getAppSettings()
          Gets the application settings.
static java.io.File getConfigurationDir()
          Returns the directory with the configuration files.
static java.io.File getServerDir()
          Returns the server directory.
static ServerZone getServerZone()
          Returns the server zone.
static boolean isApplication(java.lang.String pApplicationName)
          Checks if a given application name exists as valid application.
static boolean isSearchClassPath()
          Gets whether resource search via classpath is enabled.
static java.util.List<java.io.File> listApplicationDirectories(Configuration.ApplicationListOption pListOption)
          Lists all applications directories.
static java.util.List<java.lang.String> listApplicationNames(Configuration.ApplicationListOption pListOption)
          Gets a list of all available application names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConfigurationDir

public static java.io.File getConfigurationDir()
Returns the directory with the configuration files.

Returns:
the configuration directory

getApplicationsDir

public static java.io.File getApplicationsDir()
Returns the directory with the applications.

Returns:
the applications directory

getServerDir

public static java.io.File getServerDir()
Returns the server directory.

Returns:
the server directory

getApplicationZone

public static ApplicationZone getApplicationZone(java.lang.String pApplicationName)
                                          throws java.lang.Exception
Returns the current zone for an application.

Parameters:
pApplicationName - the desired application
Returns:
the zone for the application of null if the application is not available
Throws:
java.lang.Exception - if the application zone has errors

getServerZone

public static ServerZone getServerZone()
Returns the server zone.

Returns:
the server zone

listApplicationNames

public static java.util.List<java.lang.String> listApplicationNames(Configuration.ApplicationListOption pListOption)
Gets a list of all available application names. This method doesn't check if applications are valid.

Parameters:
pListOption - an option to ignore/list specific applications
Returns:
a list of available application names

isApplication

public static boolean isApplication(java.lang.String pApplicationName)
Checks if a given application name exists as valid application.

Parameters:
pApplicationName - an application name
Returns:
true if the application is available and is valid (configuration is available), false otherwise

getAppSettings

public static AppSettings getAppSettings()
Gets the application settings.

Returns:
the application settings

listApplicationDirectories

public static java.util.List<java.io.File> listApplicationDirectories(Configuration.ApplicationListOption pListOption)
Lists all applications directories.

Parameters:
pListOption - the list option
Returns:
the list of application directories

clearCache

public static void clearCache()
Clears the zone cache.


isSearchClassPath

public static boolean isSearchClassPath()
Gets whether resource search via classpath is enabled.

Returns:
true if search resource via classpath is enabled
See Also:
IPackageSetup.CONFIG_SEARCH_CLASSPATH


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.