ecologylab.appframework
Class PropertiesAndDirectories

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.appframework.PropertiesAndDirectories

public class PropertiesAndDirectories
extends Debug

Collects paths and methods for accessing properties that store's on the participant's machine and then accesses again.


Field Summary
protected static java.io.File _DIR
           
protected static java.io.File APPLICATION_DATA_DIR
           
protected static java.io.File DESKTOP_DIR
           
static boolean isMac
           
protected static java.io.File LAUNCH_DIR
           
static int LINUX
           
protected static java.io.File LOG_DIR
           
static int MAC
           
static int MAC_OLD
           
protected static int os
           
static java.lang.String[] OS_NAMES
           
static int OTHER_UNIX
           
protected static java.io.File TEMP_DIR
           
protected static java.io.File THIS_APPLICATION_DIR
           
static int UNKNOWN
           
protected static java.io.File USER_DIR
           
static int WINDOWS
           
 
Constructor Summary
PropertiesAndDirectories()
           
 
Method Summary
static java.io.File applicationDataDir()
          On Windows, this is typically c:\Documents and Settings\User Name\Application Data
static java.lang.String applicationName()
           
static java.io.File createDirsAsNeeded(java.io.File path)
          Create directories associated with this path, if possible.
static java.io.File desktopDir()
          A default place for storing the user's files.
static java.io.File getLaunchDir()
          For an application, the directory launched from.
static java.lang.String getOsName()
           
static java.io.File javaDeploymentProfile()
          Path to the Java deployment properties file.
static java.io.File logDir()
           
static void main(java.lang.String[] args)
           
static int os()
           
static void printProperties()
           
static boolean runningAsApplication()
           
static void setApplicationName(java.lang.String apName)
           
static void setOSSpecificProperties()
           
static java.lang.String sysProperty(java.lang.String propName)
           
static java.io.File sysTempDir()
           
static java.io.File tempDir()
           
static java.io.File thisApplicationDir()
          This function now uses the Assets class that manages caching and retrieval of assets.
static java.io.File userDir()
          A default place for storing the user's files.
static java.lang.String userDirName()
          Root directory of the current user's workspace.
 
Methods inherited from class ecologylab.generic.Debug
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

USER_DIR

protected static java.io.File USER_DIR

DESKTOP_DIR

protected static java.io.File DESKTOP_DIR

LOG_DIR

protected static java.io.File LOG_DIR

APPLICATION_DATA_DIR

protected static java.io.File APPLICATION_DATA_DIR

THIS_APPLICATION_DIR

protected static java.io.File THIS_APPLICATION_DIR

LAUNCH_DIR

protected static java.io.File LAUNCH_DIR

TEMP_DIR

protected static java.io.File TEMP_DIR

_DIR

protected static java.io.File _DIR

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

WINDOWS

public static final int WINDOWS
See Also:
Constant Field Values

LINUX

public static final int LINUX
See Also:
Constant Field Values

MAC_OLD

public static final int MAC_OLD
See Also:
Constant Field Values

MAC

public static final int MAC
See Also:
Constant Field Values

OTHER_UNIX

public static final int OTHER_UNIX
See Also:
Constant Field Values

OS_NAMES

public static final java.lang.String[] OS_NAMES

os

protected static int os

isMac

public static final boolean isMac
Constructor Detail

PropertiesAndDirectories

public PropertiesAndDirectories()
Method Detail

os

public static int os()

getOsName

public static java.lang.String getOsName()

setApplicationName

public static void setApplicationName(java.lang.String apName)

applicationName

public static java.lang.String applicationName()

thisApplicationDir

public static java.io.File thisApplicationDir()
This function now uses the Assets class that manages caching and retrieval of assets.

Returns:
The directory where we like to cache files. not user files (information spaces), but our application files.

logDir

public static java.io.File logDir()
Returns:
the appropriate directory for storing temporary files.

createDirsAsNeeded

public static java.io.File createDirsAsNeeded(java.io.File path)
Create directories associated with this path, if possible.

Parameters:
path -
Returns:
null if it was not possible to create the path, otherwise, the argument passed in.

tempDir

public static java.io.File tempDir()
Returns:
the appropriate directory for storing temporary files.

sysTempDir

public static java.io.File sysTempDir()
Returns:
name of the appropriate directory for storing temporary files.

sysProperty

public static java.lang.String sysProperty(java.lang.String propName)

applicationDataDir

public static java.io.File applicationDataDir()
On Windows, this is typically c:\Documents and Settings\User Name\Application Data


userDir

public static java.io.File userDir()
A default place for storing the user's files. In Windows, this is typically c:\\Documents and Settings\\username\\My Documents In unix-based OSes, it is typically ~.


desktopDir

public static java.io.File desktopDir()
A default place for storing the user's files. In Windows, this is typically c:\\Documents and Settings\\username


getLaunchDir

public static java.io.File getLaunchDir()
For an application, the directory launched from. Derived from System property = user.home, which doesn't seem to contain what you might think it would.


printProperties

public static void printProperties()

main

public static void main(java.lang.String[] args)

userDirName

public static java.lang.String userDirName()
Root directory of the current user's workspace.


javaDeploymentProfile

public static java.io.File javaDeploymentProfile()
Path to the Java deployment properties file. This is, among other things, where Java Plug-in properties are stored.

Returns:
Properties File for Java deployment.

runningAsApplication

public static boolean runningAsApplication()

setOSSpecificProperties

public static void setOSSpecificProperties()