|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cryptix.CryptixProperties
This class defines the version number of the Cryptix library, and also provides facilities needed to load and manage properties.
Version numbers should be written as a triple of integers, not as a decimal. If the last number is omitted it is assumed to be 0, so for example, version 1.10 is after version 1.2.
The property values are read from files called Cryptix.properties and Local.properties, which are stored in the Cryptix library directory. The Local.properties file (if it exists) adds to and overrides entries in Cryptix.properties, and is intended to be used for local customisations by a user or adminstrator.
The library directory is found by searching the current classpath. For each classpath entry, a "cryptix-lib" subdirectory is looked for. If the entry is a .zip or .jar file, "cryptix-lib" will be looked for in the same directory as that file.
Property values loaded from Cryptix.properties or Local.properties are always read-only. They can be accessed by untrusted code, so should not be secret.
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.13 $
Field Summary | |
(package private) static java.lang.String |
HTML_INFO
An HTML description of the provider. |
(package private) static java.lang.String |
LIB_DIRNAME
The name of the directory in which the properties files and (if applicable) native libraries are found. |
static boolean |
NATIVE_ALLOWED
If this constant is false, native linking is disabled regardless of any settings in the properties files. |
(package private) static java.lang.String |
PRODUCT_NAME
The common name for this class library. |
(package private) static java.lang.String[] |
PROPERTIES_FILES
The names of the properties files. |
Method Summary | |
(package private) static void |
|
static java.lang.String |
getHtmlInfo()
Returns English-language HTML credits for Cryptix, in a form that could be included in an application's About box, for example. |
static int |
getIntermediateVersion()
Returns the intermediate version of this release of Cryptix. |
static java.lang.String |
getLibraryPath()
Returns the path of the library directory. |
static int |
getMajorVersion()
Returns the major version of this release of Cryptix. |
static int |
getMinorVersion()
Returns the minor version of this release of Cryptix. |
static java.lang.String |
getProperty(java.lang.String key)
Gets the value of a property. |
static java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Gets the value of a property, or returns defaultValue if the property was not set. |
static java.lang.String |
getReleaseDate()
Returns the release date of this version of Cryptix, as a string in the form "yyyy/mm/dd". |
static java.lang.String |
getVersionString()
Returns a string describing this version of Cryptix. |
static boolean |
isVersionAtLeast(int major,
int minor,
int intermediate)
Returns true iff this version of Cryptix is at least the given version. |
static void |
list(java.io.PrintStream out)
Lists the properties to the PrintStream out. |
static void |
list(java.io.PrintWriter out)
Lists the properties to the PrintWriter out. |
static void |
main(java.lang.String[] args)
Prints the Cryptix version string, whether Cryptix is installed correctly, and the location of the library directory. |
static java.util.Enumeration |
propertyNames()
Returns an enumeration of all the property names. |
static void |
save(java.io.OutputStream os,
java.lang.String comment)
Saves the properties to the OutputStream os, in the format used by java.util.Properties.save . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean NATIVE_ALLOWED
static final java.lang.String HTML_INFO
static final java.lang.String PRODUCT_NAME
static final java.lang.String LIB_DIRNAME
static final java.lang.String[] PROPERTIES_FILES
Method Detail |
public static int getMajorVersion()
public static int getMinorVersion()
public static int getIntermediateVersion()
public static boolean isVersionAtLeast(int major, int minor, int intermediate)
public static java.lang.String getReleaseDate()
public static java.lang.String getVersionString()
public static java.lang.String getHtmlInfo()
The returned string does not have <HTML> or <BODY> tags, so that it can easily be included in a larger page.
public static void main(java.lang.String[] args)
static void()
public static java.lang.String getLibraryPath() throws java.io.IOException
The returned path is always absolute, and ends with a file separator character (e.g. "/" on Unix).
java.io.IOException
- if an error occurred during intialization,
preventing the path from being determined.public static void save(java.io.OutputStream os, java.lang.String comment)
java.util.Properties.save
. The string comment
is written as a comment in the first line of the output.public static java.lang.String getProperty(java.lang.String key)
public static java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
public static java.util.Enumeration propertyNames()
public static void list(java.io.PrintStream out)
public static void list(java.io.PrintWriter out)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |