|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.taverna.raven.appconfig.ApplicationUserHome
public class ApplicationUserHome
Find and create an application's user directory according to operating system standards.
For example for the application "MyApp" this class will be able to find
$HOME/.myapp on Linux or
C:\Document and settings\MyUsername\Application Data\MyApplication
on Windows XP.
| Constructor Summary | |
|---|---|
ApplicationUserHome(java.lang.String applicationName)
Initialise with the name of the application. |
|
ApplicationUserHome(java.lang.String applicationName,
java.lang.String defaultApplicationHome)
Initialise with the name of the application and a default application home. |
|
| Method Summary | |
|---|---|
java.lang.String |
getApplicationName()
The application's name. |
java.io.File |
getAppUserHome()
Find (and if necessary create) the user's application directory, according to operating system standards. |
java.lang.String |
getDefaultApplicationHome()
The full path to the default home directory. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ApplicationUserHome(java.lang.String applicationName)
applicationName - This name will be used as a template for creating the
application home directory (but might be transcribed, for
instance to lowercase). It is generally recommended, but not
required - that this name does not contain spaces or any
special international/Unicode characters.
public ApplicationUserHome(java.lang.String applicationName,
java.lang.String defaultApplicationHome)
applicationName - This name will be used as a template for creating the
application home directory (but might be transcribed, for
instance to lowercase). It is generally recommended, but not
required - that this name does not contain spaces or any
special international/Unicode characters.defaultApplicationHome - The full path to the default home directory. If this string is
not null, then a File based on this
directory will always be returned by
getDefaultApplicationHome() - otherwise the normal
operating system logic is used to determine the application's
home directory.| Method Detail |
|---|
public java.io.File getAppUserHome()
File object.
The application's name as defined by getApplicationName() is
used as a basis for naming the directory of the application's user
directory, but the directory name might for instance be transformed to
lowercase.
If getDefaultApplicationHome() returns a non-null value, the
directory specified by that path will be used instead of the operation
system specific directory. The directory will be created if needed.
If any exception occurs (such as out of diskspace), null
will be returned.
On Windows XP, this will typically be something like:
C:\Document and settings\MyUsername\Application Data\MyApplication
and on Windows Vista it would be something like:
C:\Users\MyUsername\Application Data\MyApplication
while on Mac OS X it will be something like:
/Users/MyUsername/Library/Application Support/MyApplication
All other OS'es are assumed to be UNIX-alike, returning something like:
/user/myusername/.myapplication
If the directory does not already exist, it will be created.
File referring to an existing directory for
user-specific configuration etc. for the given application.public java.lang.String getApplicationName()
public java.lang.String getDefaultApplicationHome()
null, then a File based on this directory will
always be returned by getDefaultApplicationHome() - otherwise
the normal operating system logic is used to determine the application's
home directory.
null if the operation system specific logic is to
be used.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||