util
Class Deploy

java.lang.Object
  extended by util.Deploy

public class Deploy
extends Object

Some static routines to allow deployment of java applications from a jar file.


Constructor Summary
Deploy()
           
 
Method Summary
static void ask(Map<String,String> prop, String key, String query)
          On first start, calling this method with an argument map and a string key, the user is asked to input the correct key setting on the command line.
private static boolean canRead(File that)
          Checks, if a file/directory exists and is readable.
private static boolean canWrite(File that)
          Checks, if a file/directory exists and is readable.
static boolean checkReadConfig()
          Checkis if the user home directory exists and can be writtn.
static boolean checkReadHome()
          Checkis if the user home directory exists and can be writtn.
static File getConfig()
          Returns the config directory as a file.
static File getCurrent()
          Returns the current directory as a file.
static File getHome()
          Returns the user's home directory as a file.
static void jask(Map<String,String> prop, String key, String query)
          Displays a dialog for input of string answers.
static Map<String,String> loadNormalOrder(String res)
          Tries to read properties from the default locations ion the following order: First config, then home, last current.
static Map<String,String> propertiesFromConfig(String res)
          Tries to read from home directory the stated property bearing definitions.
static Map<String,String> propertiesFromCurrent(String res)
          Tries to read from current directory the stated property bearing definitions.
static Map<String,String> propertiesFromHome(String res)
          Tries to read from home directory the stated property bearing definitions.
static boolean saveNormalOrder(PropertyBearing prop, String res, String remark)
          Save the properties in normal order: First config, then home, last current.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deploy

public Deploy()
Method Detail

ask

public static void ask(Map<String,String> prop,
                       String key,
                       String query)
On first start, calling this method with an argument map and a string key, the user is asked to input the correct key setting on the command line. If the command line query is non-null, this line is printed, otherwise only the key is echoed.


jask

public static void jask(Map<String,String> prop,
                        String key,
                        String query)
Displays a dialog for input of string answers. A workaround for os, where there is only limited access to standard in.


loadNormalOrder

public static Map<String,String> loadNormalOrder(String res)
Tries to read properties from the default locations ion the following order: First config, then home, last current. If retrieval is not possible from any of these sources, we return null. If retrieval is successful, the appropriate boolean is set in the properties returned.


saveNormalOrder

public static boolean saveNormalOrder(PropertyBearing prop,
                                      String res,
                                      String remark)
Save the properties in normal order: First config, then home, last current. If saving is possible, the appropriate flag is set.


propertiesFromConfig

public static Map<String,String> propertiesFromConfig(String res)
Tries to read from home directory the stated property bearing definitions. If the resource cannot be found, null is returned.


propertiesFromHome

public static Map<String,String> propertiesFromHome(String res)
Tries to read from home directory the stated property bearing definitions. If the resource cannot be found, null is returned.


propertiesFromCurrent

public static Map<String,String> propertiesFromCurrent(String res)
Tries to read from current directory the stated property bearing definitions. If the resource cannot be found, null is returned.


checkReadHome

public static boolean checkReadHome()
Checkis if the user home directory exists and can be writtn.


checkReadConfig

public static boolean checkReadConfig()
Checkis if the user home directory exists and can be writtn.


getHome

public static File getHome()
Returns the user's home directory as a file.


getCurrent

public static File getCurrent()
Returns the current directory as a file.


getConfig

public static File getConfig()
Returns the config directory as a file.


canRead

private static boolean canRead(File that)
Checks, if a file/directory exists and is readable.


canWrite

private static boolean canWrite(File that)
Checks, if a file/directory exists and is readable.