|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.internal.api.RelativePathResolver
public class RelativePathResolver
The purpose of this class is to expand paths that contain embedded system properties of the form ${property-name}. The result must be an absolute path, or messages are logged. Here are some examples: ${com.sun.aas.installRoot}/config/domain.xml /foo/${config}/domain.xml /foo/${config}/${domain-name} This class is used to map paths containing system properties in domain.xml and used so that absolute paths (which are installation directory specific) are not present, making domain.xml portable in an SE/EE environment across many machines (with different installation directories).
| Constructor Summary | |
|---|---|
RelativePathResolver()
|
|
| Method Summary | |
|---|---|
protected void |
fatalError(java.lang.String message,
java.lang.String path)
You would like to think that we could just log and continue (without throwing a RuntimeException; however, unfortunately anything logged by the logger in the launcher (PELaucnhFilter) does not appear in server.log, so for now, this will be considered a fatal error. |
static java.lang.String |
getAlias(java.lang.String propName)
check if a given property name matches AS alias pattern ${ALIAS=aliasname}. |
protected static java.util.logging.Logger |
getLogger()
|
protected java.lang.String |
getPropertyValue(java.lang.String propName,
boolean bIncludingEnvironmentVariables)
Resolves the given property by returning its value as either 1) a system property of the form ${system-property-name} 2) a password alias property of the form ${ALIAS=aliasname}. |
static java.lang.String |
getRealPasswordFromAlias(java.lang.String at)
Returns the actual password from the domain-wide safe password store, if the given password is aliased. |
boolean |
isResolvable(java.lang.String path,
boolean bIncludingEnvironmentVariables)
checks if string does not consist of unresolvable values |
static void |
main(java.lang.String[] args)
|
java.lang.String |
resolve(java.lang.String path)
|
java.lang.String |
resolve(java.lang.String path,
boolean bIncludingEnvironmentVariables)
Replace any system properties of the form ${property} in the given path. |
static java.lang.String |
resolvePath(java.lang.String path)
|
java.lang.String |
unresolve(java.lang.String path,
java.lang.String[] propNames)
unresolvePath will replace the first occurrence of the value of the given system properties with ${propName} in the given path |
static java.lang.String |
unresolvePath(java.lang.String path,
java.lang.String[] propNames)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RelativePathResolver()
| Method Detail |
|---|
protected static java.util.logging.Logger getLogger()
public static java.lang.String unresolvePath(java.lang.String path,
java.lang.String[] propNames)
public static java.lang.String resolvePath(java.lang.String path)
public java.lang.String unresolve(java.lang.String path,
java.lang.String[] propNames)
protected void fatalError(java.lang.String message,
java.lang.String path)
public static java.lang.String getAlias(java.lang.String propName)
propName - The property name to resolve. ex. ${ALIAS=aliasname}.
protected java.lang.String getPropertyValue(java.lang.String propName,
boolean bIncludingEnvironmentVariables)
propName - The property name to resolve
public java.lang.String resolve(java.lang.String path)
public java.lang.String resolve(java.lang.String path,
boolean bIncludingEnvironmentVariables)
public boolean isResolvable(java.lang.String path,
boolean bIncludingEnvironmentVariables)
public static void main(java.lang.String[] args)
public static java.lang.String getRealPasswordFromAlias(java.lang.String at)
throws java.security.KeyStoreException,
java.security.cert.CertificateException,
java.io.IOException,
java.security.NoSuchAlgorithmException,
java.security.UnrecoverableKeyException
at - is the aliased token of the form "${ALIAS=string}"
java.lang.IllegalArgumentException - if the alias is not defined
java.security.KeyStoreException - CertificateException IOException NoSuchAlgorithmException
UnrecoverableKeyException if there is an error is opening or
processing the password store
java.security.cert.CertificateException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.UnrecoverableKeyException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||