org.gcube.common.mycontainer
Class Utils

java.lang.Object
  extended by org.gcube.common.mycontainer.Utils

public class Utils
extends Object

API-wide utilities and constants.

Author:
Fabio Simeoni

Field Summary
static String CONFIG_DIR
          The local name of the configuration folder inside the install location of the container.
static String CONTAINER_LOCATION_PROPERTY
          The system property that identifies the install location of the container.
static String DEFAULT_INSTALL_DIRECTORY
           
static int DEFAULT_PORT
          The default timeout on startup.
static int DEFAULT_STARTUP_TIMEOUT
          The default timeout on startup.
static String ETC_DIR
          The local name of the deployment folder inside the install location of the container.
static String LIB_DIR
          The local name of the library folder inside the install location of the container.
static String PORT_PROPERTY
          The name of the property for the timeout on startup
static String PROPERTY_FILE
           
static String STARTUP_TIMEOUT_PROPERTY
          The name of the property for the timeout on startup
static String STORAGE_DIR
          The local name of the storage folder inside the install location of the container.
 
Constructor Summary
Utils()
           
 
Method Summary
static Properties findContainerLocation()
          Returns a singleton Properties with the CONTAINER_LOCATION_PROPERTY set to the installation of a container found on the local file system.
static Properties findContainerProperties()
          Returns the Properties in a PROPERTY_FILE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTAINER_LOCATION_PROPERTY

public static final String CONTAINER_LOCATION_PROPERTY
The system property that identifies the install location of the container.

See Also:
Constant Field Values

DEFAULT_INSTALL_DIRECTORY

public static final String DEFAULT_INSTALL_DIRECTORY
See Also:
Constant Field Values

PROPERTY_FILE

public static final String PROPERTY_FILE
See Also:
Constant Field Values

STARTUP_TIMEOUT_PROPERTY

public static final String STARTUP_TIMEOUT_PROPERTY
The name of the property for the timeout on startup

See Also:
Constant Field Values

DEFAULT_STARTUP_TIMEOUT

public static final int DEFAULT_STARTUP_TIMEOUT
The default timeout on startup.

See Also:
Constant Field Values

CONFIG_DIR

public static final String CONFIG_DIR
The local name of the configuration folder inside the install location of the container.

See Also:
Constant Field Values

ETC_DIR

public static final String ETC_DIR
The local name of the deployment folder inside the install location of the container.

See Also:
Constant Field Values

LIB_DIR

public static final String LIB_DIR
The local name of the library folder inside the install location of the container.

See Also:
Constant Field Values

STORAGE_DIR

public static final String STORAGE_DIR
The local name of the storage folder inside the install location of the container.

See Also:
Constant Field Values

PORT_PROPERTY

public static final String PORT_PROPERTY
The name of the property for the timeout on startup

See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
The default timeout on startup.

See Also:
Constant Field Values
Constructor Detail

Utils

public Utils()
Method Detail

findContainerLocation

public static Properties findContainerLocation()
Returns a singleton Properties with the CONTAINER_LOCATION_PROPERTY set to the installation of a container found on the local file system.

The search for the install location follows this strategy:

Returns:
a singleton Properties with the CONTAINER_LOCATION_PROPERTY set to the installation of a container.

findContainerProperties

public static Properties findContainerProperties()
                                          throws IllegalStateException
Returns the Properties in a PROPERTY_FILE.

The search for the PROPERTY_FILE considers the following locations, in the order in which they are listed:

  • on the classpath.
  • in the working directory.
  • in the user's home.

    Returns:
    the properties
    Throws:
    IllegalStateException - if PROPERTY_FILE cannot be found


  • Copyright © 2013. All Rights Reserved.