public class EnvironmentOps
extends java.lang.Object
This supports some common global variables that are called built-in
functions in Progress but which take no parameters, not even empty
parenthesis. These variables are read-only (they cannot be assigned),
except for PROPATH
which can be modified as it can be in
Progress as well.
The following is the list of supported variables:
Progress Variable Java Equivalent --------------------- ---------------------- current-languagegetCurrentLanguage()
dataserversgetDataServerList()
gatewaysgetDataServerList()
opsysgetOperatingSystem()
progressgetRuntimeType()
promsgsgetMessageSource()
propathgetSearchPath()
proversiongetVersion()
Progress Language Statement Java Equivalent --------------------------- ---------------------- get-key-valuegetKeyValue(com.goldencode.p2j.util.character)
loadload(com.goldencode.p2j.util.character)
propathsetSearchPath(java.lang.String, boolean)
put-key-valuesetKeyValue(com.goldencode.p2j.util.character, java.lang.String)
unloadunload(java.lang.String)
useuse(java.lang.String)
Progress Function Java Equivalent
--------------------- ----------------------
program-name getSourceName(com.goldencode.p2j.util.int64)
System Handle:Attribute Java Equivalent ------------------------- ---------------------- session:batch-modeisBatchMode()
(get) session:charsetgetCharset()
(get) session:cpinternalgetCPInternal()
(get) session:cpstreamgetCPStream()
(get) session:temp-directorygetTempDirectory()
(get)
Modifier and Type | Class and Description |
---|---|
private static class |
EnvironmentOps.ContextContainer
Simple container that stores and returns a context-local instance of
the global work area.
|
private static class |
EnvironmentOps.WorkArea
Stores global data relating to the state of the current context.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
OS_UNIX
Progress OPSYS string for Unix systems.
|
static java.lang.String |
OS_WIN
Progress OPSYS string for Windows systems.
|
static java.util.Map<java.lang.String,java.lang.String> |
osMap
Maps known Java os.name system property entries to a given Progress
OPSYS string.
|
static java.lang.String |
PROPATH_SEPARATOR
Progress PROPATH separator string for all systems.
|
private static java.lang.String |
propathFixed
The fixed default part of the PROPATH value.
|
private static EnvironmentOps.ContextContainer |
work
Stores context-local state variables.
|
Constructor and Description |
---|
EnvironmentOps() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
addSourcePathListener(java.util.function.Consumer<java.lang.String> listener)
Add a new listener to be notified when the PROPATH has been set.
|
static java.lang.String |
fixupPropath(java.lang.String propathInitial)
Substitutes the path separator values with the comma character in
the given string and returns the 4GL compatible PROPATH value that is
the combination of the directory entries separated by comma.
|
static character |
getCharset()
Reports the default charset used by the JVM.
|
private static java.lang.String |
getClientOpSysName(EnvironmentOps.WorkArea wa)
Gets the name of the operating system upon which the Progress compatible client environment
is running.
|
static character |
getCPInternal()
Reports the default codepage used by the JVM.
|
static character |
getCPStream()
Reports the codepage used for streams (the equivalent of the CPSTREAM 4GL attribute, which
reports the value set using the
-cpstream startup parameter. |
static java.lang.String |
getCurrentEnvironmentName()
Get current environment name.
|
static character |
getCurrentLanguage()
Gets the name of the current language being used for the Progress
compatible environment.
|
static character |
getCurrentPrinterName()
Get the name of the current printer.
|
static character |
getDataServerList()
Gets the list of the data servers available in Progress compatible
environment.
|
static java.lang.String |
getEnvironmentName()
Get the current environment's name.
|
static java.lang.String |
getEnvironmentType()
Get the current environment type.
|
static character |
getKeyValue(character section)
Getting the default key value from the current environment.
|
static character |
getKeyValue(character section,
character key)
Getting the key value from the current environment.
|
static character |
getKeyValue(character section,
java.lang.String key)
Getting the key value from the current environment.
|
static character |
getKeyValue(java.lang.String section)
Getting the default key value from the current environment.
|
static character |
getKeyValue(java.lang.String section,
character key)
Getting the key value from the current environment.
|
static character |
getKeyValue(java.lang.String section,
java.lang.String key)
Getting the key value from the current environment.
|
static java.util.Map<java.lang.String,java.lang.String> |
getLegacyAbsolutePathPrefixMap()
Gets the absolute path prefix map from the current directory settings.
|
static boolean |
getLegacyCaseSensitive()
Gets the original Progress SOURCE file system's case-sensitive setting
which must be maintained for certain runtime translations of dynamically
generated names (the algorithms of which were designed with that path
assumed) but which is not necessarily a valid path on the system on
which this is running.
|
static java.util.Map<java.lang.String,java.lang.String> |
getLegacyEnvironmentVariables(boolean caseInsensitiveKeys)
Gets the environment variables map from the current directory settings.
|
static java.lang.String |
getLegacyFileSeparator()
Gets the original Progress SOURCE system's file separator which must be
maintained for certain runtime translations of dynamically generated
names (the algorithms of which were designed with that path assumed)
but which is not necessarily a valid path on the system on which this
is running.
|
static java.lang.String |
getLegacyPathSeparator()
Gets the original Progress SOURCE system's path separator which must be
maintained for certain runtime translations of dynamically generated
names (the algorithms of which were designed with that path assumed)
but which is not necessarily a valid path on the system on which this
is running.
|
static java.lang.String |
getLegacyPlatform()
Get client legacy platform name.
|
static java.lang.String |
getLegacySearchPath()
Gets the original Progress SOURCE system's PROPATH which must be
maintained for certain runtime translations of dynamically generated
names (the algorithms of which were designed with that path assumed)
but which is not necessarily a valid path on the system on which this
is running.
|
static character |
getMessageSource()
Gets the name of the current message source being used for the Progress
compatible environment.
|
static character |
getOperatingSystem()
Gets the name of the operating system upon which the Progress compatible
client environment is running.
|
static java.lang.String |
getPathSeparator()
Gets the path separator character used to parse the Progress search
path (see
getSearchPath() ). |
static integer |
getProcessArchitecture()
Returns the word size of the client's compiled native code, which may be different
from the "bitness" of the client's OS.
|
static character |
getRuntimeOperatingSystem()
Gets the name of the operating system being upon which the Progress compatible client
environment is running.
|
static character |
getRuntimeType()
Gets the current runtime type being provided by the Progress
compatible environment.
|
static character |
getSearchPath()
Gets the Progress search path on the TARGET P2J system which is
used for the Progress compatible environment.
|
static java.lang.String[] |
getSearchPathList()
Gets the list of directories in the Progress source file path.
|
static java.lang.String |
getSearchPathOverride()
Gets any context-specific override for the Progress search path which
was previously set via
setSearchPath(java.lang.String, boolean) . |
static character |
getSourceName(int64 index)
Returns the Progress source file name that matches the program at the given index in the
stack trace if the given index position exists.
|
static character |
getSourceName(long index)
Returns the Progress source file name that matches the program at the given index in the
stack trace if the given index position exists.
|
static character |
getTempDirectory()
Gets the name of the directory where temporary files are stored.
|
static character |
getVersion()
Gets the current version string of the Progress compatible environment.
|
static logical |
isBatchMode()
Reports if the current context is running in batch mode.
|
static boolean |
isCustomEnvironment()
Check if a custom environment is in use.
|
private static boolean |
isIniType()
Check if it's a INI file environment type.
|
static boolean |
isUnderWindowsFamily()
Checks is the current OS the P2J is running on belongs to the Windows
family.
|
static void |
load(character env)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
boolean flagNew)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
boolean flagNew,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
character directory)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
character directory,
boolean flagNew)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
character directory,
boolean flagNew,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
character directory,
character baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
character directory,
logical flagNew,
character baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
character directory,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
java.lang.String directory)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
java.lang.String directory,
boolean flagNew)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
java.lang.String directory,
boolean flagNew,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(character env,
java.lang.String directory,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
boolean flagNew)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
boolean flagNew,
character baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
boolean flagNew,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
character directory)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
character directory,
boolean flagNew)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
character directory,
boolean flagNew,
character baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
character directory,
boolean flagNew,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
character directory,
character baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
character directory,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
java.lang.String directory)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
java.lang.String directory,
boolean flagNew)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
java.lang.String directory,
boolean flagNew,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
static void |
load(java.lang.String env,
java.lang.String directory,
java.lang.String baseKey)
Creates application defaults implementing Progress LOAD statement.
|
private static void |
onLoadError(character env,
character directory)
On load error message.
|
private static void |
onUnload(java.lang.String envName)
A notification when
UNLOAD environment statement is executed. |
private static void |
onUse(java.lang.String envName)
A notification when
USE environment statement is executed. |
static void |
setBatchMode(boolean batchMode)
Force the batch mode of the current context to the specified state.
|
static void |
setCurrentLanguage(character val)
Sets the name of the current language being used for the Progress compatible environment.
|
static void |
setCurrentLanguage(java.lang.String val)
Sets the name of the current language being used for the Progress compatible environment.
|
static void |
setKeyValue(character section,
character value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(character section,
character key,
character value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(character section,
character key,
java.lang.String value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(character section,
java.lang.String value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(character section,
java.lang.String key,
character value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(character section,
java.lang.String key,
java.lang.String value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(java.lang.String section,
character value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(java.lang.String section,
character key,
character value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(java.lang.String section,
character key,
java.lang.String value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(java.lang.String section,
java.lang.String value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(java.lang.String section,
java.lang.String key,
character value)
Adds, modifies and deletes keys in current environment.
|
static void |
setKeyValue(java.lang.String section,
java.lang.String key,
java.lang.String value)
Adds, modifies and deletes keys in current environment.
|
static void |
setSearchPath(character path)
Sets the Progress search path on the TARGET P2J system which is
used for the Progress compatible environment.
|
static void |
setSearchPath(java.lang.String path)
Sets the Progress search path on the TARGET P2J system which is
used for the Progress compatible environment.
|
static void |
setSearchPath(java.lang.String path,
boolean cvt)
Sets the Progress search path on the TARGET P2J system which is
used for the Progress compatible environment.
|
private static java.lang.String[] |
splitPath(java.lang.String path,
java.lang.String separator)
Splits a path using the alternative separator string
|
static void |
unload(character env)
Unloads specified environment from the current one if possible.
|
static void |
unload(java.lang.String env)
Unloads specifies environment from the current one.
|
static void |
use(character env)
Specifies environment defaults to use in subsequent windows.
|
static void |
use(java.lang.String env)
Specifies environment defaults to use in subsequent windows.
|
public static final java.lang.String OS_UNIX
public static final java.lang.String OS_WIN
public static final java.lang.String PROPATH_SEPARATOR
public static final java.util.Map<java.lang.String,java.lang.String> osMap
private static java.lang.String propathFixed
private static EnvironmentOps.ContextContainer work
public static character getCurrentLanguage()
The value returned may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/currentLanguage
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/currentLanguage
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/currentLanguage
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/currentLanguage
If no value is found via this lookup, then the default value of "?" will be returned.
public static void setCurrentLanguage(java.lang.String val)
This value will be saved in the directory in the /server/<serverID>/runtime/<account>/currentLanguage node.
All intermediary parents will be created.
val
- The new CURRENT-LANGUAGE value.public static void setCurrentLanguage(character val)
This value will be saved in the directory in the /server/<serverID>/runtime/<account>/currentLanguage node.
All intermediary parents will be created.
val
- The new CURRENT-LANGUAGE value.public static character getDataServerList()
The value returned may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/dataServers
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/dataServers
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/dataServers
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/dataServers
If no value is found via this lookup, then the default value of "PROGRESS,ORACLE,AS400,ODBC,MSS" will be returned.
public static character getOperatingSystem()
The value returned may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/opsys/override
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/opsys/override
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/opsys/override
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/opsys/override
If no value is found via this lookup, then the Java system property "os.name" is queried. This is then translated via an optional mapping table in the directory (that same paths and precedence as above but ending in "opsys/mapping/<lowercased_system_propert_name>.
If no mapping is found, then an internal mapping table in this class is consulted. This table maps the following:
os.name Progress OPSYS ---------------- --------------- "linux" "UNIX" "aix" "UNIX" "solaris" "UNIX" "sunos" "UNIX" "hp-ux" "UNIX" "freebsd" "UNIX" "mac os x" "UNIX" "windows xp" "WIN32" "windows 2000" "WIN32" "windows nt" "WIN32" "windows me" "WIN32" "windows 98" "WIN32" "windows 95" "WIN32"
If there is still no match, then any os.name
with the
lowercase text "unix" will return "UNIX" and any os.name
with the lowercase text "windows" will return "WIN32".
If there is still no match, the os.name
returned by
Java will be returned.
public static character getRuntimeOperatingSystem()
getOperatingSystem()
in that
the first attempt to resolve this value will NOT occur via a lookup in the directory under
the opsys/override
key. However, the rest of the resolution of this value is the
same as is described in getOperatingSystem()
.public static boolean isUnderWindowsFamily()
true
if the current OS is from Windows family or
false
otherwise.public static character getRuntimeType()
public static character getTempDirectory()
SESSION:TEMP-DIRECTORY
system
handle attribute.public static character getMessageSource()
public static void setSearchPath(java.lang.String path, boolean cvt)
The PROPATH is also used in the implementation of
FileSystemOps.searchPath(com.goldencode.p2j.util.character)
. The actual I/O operations when
executed via the Progress compatible interface (see
FileSystemOps
and Stream
) for a P2J system are executed
on the P2J client. This is the TARGET system on which this path is
valid.
This must be distinguished from the original Progress SOURCE system's
PROPATH which must be maintained for certain runtime translations
of dynamically generated names (the algorithms of which were designed
with that path assumed) but which is not necessarily a valid path on
the system on which this is running. The original PROPATH can be
obtained via the getLegacySearchPath()
method.
path
- The replacement path to Progress source files.cvt
- This marks if the function is being called at conversion time or not.public static void setSearchPath(java.lang.String path)
The PROPATH is also used in the implementation of
FileSystemOps.searchPath(com.goldencode.p2j.util.character)
. The actual I/O operations when
executed via the Progress compatible interface (see
FileSystemOps
and Stream
) for a P2J system are executed
on the P2J client. This is the TARGET system on which this path is
valid.
This must be distinguished from the original Progress SOURCE system's
PROPATH which must be maintained for certain runtime translations
of dynamically generated names (the algorithms of which were designed
with that path assumed) but which is not necessarily a valid path on
the system on which this is running. The original PROPATH can be
obtained via the getLegacySearchPath()
method.
path
- The replacement path to Progress source files.public static void setSearchPath(character path)
The PROPATH is also used in the implementation of
FileSystemOps.searchPath(com.goldencode.p2j.util.character)
. The actual I/O operations when
executed via the Progress compatible interface (see
FileSystemOps
and Stream
) for a P2J system are executed
on the P2J client. This is the TARGET system on which this path is
valid.
This must be distinguished from the original Progress SOURCE system's
PROPATH which must be maintained for certain runtime translations
of dynamically generated names (the algorithms of which were designed
with that path assumed) but which is not necessarily a valid path on
the system on which this is running. The original PROPATH can be
obtained via the getLegacySearchPath()
method.
path
- The replacement path to Progress source files.public static java.lang.String getSearchPathOverride()
setSearchPath(java.lang.String, boolean)
.null
if no override was
ever set.public static character getSearchPath()
FileSystemOps.searchPath(com.goldencode.p2j.util.character)
. The actual I/O
operations when executed via the Progress compatible interface (see
FileSystemOps
and Stream
) for a P2J system are executed
on the P2J client. This is the TARGET system on which this path is
valid.
This must be distinguished from the original Progress SOURCE system's
PROPATH which must be maintained for certain runtime translations
of dynamically generated names (the algorithms of which were designed
with that path assumed) but which is not necessarily a valid path on
the system on which this is running. The original PROPATH can be
obtained via the getLegacySearchPath()
method.
If a specific PROPATH has been assigned in this user's context, then that "override" will be returned. Otherwise, the directory will be consulted for the stored version.
The value returned from the directory may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/searchpath
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/searchpath
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/searchpath
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/searchpath
If no value is found via this lookup, then the default value of ".," will be returned.
public static java.lang.String fixupPropath(java.lang.String propathInitial)
propathInitial
- The PROPATH that possibly needs to be fixed due to containing
of the path separators instead of the expected comma values.public static java.lang.String getLegacySearchPath()
The value returned may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/legacy-system/propath
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/legacy-system/propath
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/legacy-system/propath
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/legacy-system/propath
If no value is found via this lookup, then the default value of "" (empty string) will be returned.
This must be distinguished from Progress source file/search path on the
TARGET P2J system which is used for the Progress compatible
environment. To obtain that value, use getSearchPath()
.
public static java.lang.String getPathSeparator()
getSearchPath()
).
The value returned may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/path-separator
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/path-separator
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/path-separator
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/path-separator
If no value is found via this lookup, then the default value of ':' will be returned.
public static java.lang.String getLegacyPathSeparator()
The value returned may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/legacy-system/path-separator
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/legacy-system/path-separator
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/legacy-system/path-separator
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/legacy-system/path-separator
If no value is found via this lookup, then the default value of ":" will be returned.
This must be distinguished from the path separator on the (runtime)
TARGET P2J system which is used for the Progress compatible
environment. To obtain that value, use getPathSeparator()
.
public static java.lang.String[] getSearchPathList()
File.pathSeparator
. The resulting array is
returned to the caller.
The getSearchPath()
is used for the path specification and
the getPathSeparator()
is used to split the path.
public static java.lang.String getLegacyFileSeparator()
The value returned may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/legacy-system/file-separator
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/legacy-system/file-separator
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/legacy-system/file-separator
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/legacy-system/file-separator
If no value is found via this lookup, then the default value of "/" will be returned.
public static java.util.Map<java.lang.String,java.lang.String> getLegacyAbsolutePathPrefixMap()
public static java.util.Map<java.lang.String,java.lang.String> getLegacyEnvironmentVariables(boolean caseInsensitiveKeys)
caseInsensitiveKeys
- true
to use case-insensitive keys for the environment variables map.public static boolean getLegacyCaseSensitive()
The value returned may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/legacy-system/case-sensitive
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/legacy-system/case-sensitive
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/legacy-system/case-sensitive
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/legacy-system/case-sensitive
If no value is found via this lookup, then the default value of
true
will be returned.
true
if the legacy file system was
case-sensitive.public static character getVersion()
The value returned may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/version
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/version
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/version
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/version
If no value is found via this lookup, then the default value of "10.2B" will be returned.
public static character getSourceName(int64 index)
ProcedureManager.getStackEntry(int)
.index
- The 1-based index position in the call stack to be returned. Decimal values are
not allowed in the 4GL (compile-time error), but any 64-bit integer value is
allowed.public static character getSourceName(long index)
ProcedureManager.getStackEntry(int)
.index
- The 1-based index position in the call stack to be returned. Decimal values are
not allowed in the 4GL (compile-time error), but any 64-bit integer value is
allowed.private static java.lang.String[] splitPath(java.lang.String path, java.lang.String separator)
path
- The String
path to split into an array of directory
names.separator
- The String
separator to split into an array of directory
names.public static logical isBatchMode()
The value returned may have been found via a search algorithm that is account (user or process) specific or group specific within the current server or a global default for all servers.
The implementation iteratively looks up the directory node under: /server/<serverID>/runtime/<account_or_group>/batchMode
If no user/process or group nodes are present, then this is checked: /server/<serverID>/runtime/default/batchMode
If no /server/<serverID>/runtime node exists, this is checked (it is the global default area for all servers): /server/default/runtime/<account_or_group>/batchMode
Finally, if no user/process or group nodes are present in the global default area, then this is checked: /server/default/runtime/default/batchMode
If no value is found via this lookup, then the default value of
false
will be returned.
true
if the current context is in batch mode.public static void setBatchMode(boolean batchMode)
batchMode
- true
if this context must be in batch mode.public static character getCharset()
If the 4GL environment is actually configured for UTF-8, then this approach won't work. If the default codepage name for the JVM is not UTF-8, it is assumed that the codepage has been overriden already (at JVM startup). In that case, the value reported by the JVM is returned unchanged.
public static character getCPInternal()
If the 4GL environment is actually configured for UTF-8, then this approach won't work. If the default codepage name for the JVM is not UTF-8, it is assumed that the codepage has been overriden already (at JVM startup). In that case, the value reported by the JVM is returned unchanged.
public static character getCPStream()
-cpstream
startup parameter.public static void load(character env)
env
- The environment to create or load. Can be the registry key,
initialization file.public static void load(java.lang.String env)
env
- The environment to create or load. Can be the registry key,
initialization file.public static void load(character env, boolean flagNew)
env
- The environment to create or load. Can be the registry key,
initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.public static void load(java.lang.String env, boolean flagNew)
env
- The environment to create or load. Can be the registry key,
initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.public static void load(character env, boolean flagNew, java.lang.String baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(java.lang.String env, boolean flagNew, java.lang.String baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(java.lang.String env, boolean flagNew, character baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(character env, character directory)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.public static void load(java.lang.String env, character directory)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.public static void load(character env, java.lang.String directory)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.public static void load(java.lang.String env, java.lang.String directory)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.public static void load(character env, character directory, boolean flagNew)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.public static void load(java.lang.String env, character directory, boolean flagNew)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.public static void load(character env, java.lang.String directory, boolean flagNew)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.public static void load(java.lang.String env, java.lang.String directory, boolean flagNew)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.public static void load(character env, character directory, java.lang.String baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(character env, character directory, character baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(character env, java.lang.String directory, java.lang.String baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(java.lang.String env, character directory, java.lang.String baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(java.lang.String env, character directory, character baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(java.lang.String env, java.lang.String directory, java.lang.String baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(character env, character directory, boolean flagNew, java.lang.String baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(character env, java.lang.String directory, boolean flagNew, java.lang.String baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(java.lang.String env, character directory, boolean flagNew, java.lang.String baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(java.lang.String env, character directory, boolean flagNew, character baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(java.lang.String env, java.lang.String directory, boolean flagNew, java.lang.String baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.public static void load(character env, character directory, logical flagNew, character baseKey)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.flagNew
- If true
- the new file or registry key will be
created overwriting the possibly existed one.baseKey
- When the parameter is specified the serching is performed under
the particular key value. It is possible to specify "INI" as
parameter. In this case search or creation will be dome inside
initialization file specified in env parameter.private static void onLoadError(character env, character directory)
env
- The environment to create or load. Can be the registry key,
initialization file.directory
- The directory path for existing initialization file or place
to create initialization file.public static void use(java.lang.String env)
env
- The environment to load. If the parameter is empty string ("") the default
environment becomes the current one.public static void use(character env)
env
- The environment to load. If the parameter is empty string ("") the default
environment becomes the current one.public static boolean isCustomEnvironment()
public static java.lang.String getEnvironmentName()
public static java.lang.String getEnvironmentType()
public static character getCurrentPrinterName()
public static void setKeyValue(character section, java.lang.String value)
section
- The name of the section containing the key to modify.value
- The new value of the key under modification.public static void setKeyValue(java.lang.String section, character value)
section
- The name of the section containing the key to modify.value
- The new value of the key under modification.public static void setKeyValue(java.lang.String section, java.lang.String value)
section
- The name of the section containing the key to modify.value
- The new value of the key under modification.public static void setKeyValue(character section, character value)
section
- The name of the section containing the key to modify.value
- The new value of the key under modification.public static void setKeyValue(character section, character key, java.lang.String value)
section
- The name of the section containing the key to modify.key
- The name of the key key to modify or default key if not specified.value
- The new value of the key under modification.public static void setKeyValue(character section, java.lang.String key, character value)
section
- The name of the section containing the key to modify.key
- The name of the key key to modify or default key if not specified.value
- The new value of the key under modification.public static void setKeyValue(java.lang.String section, character key, character value)
section
- The name of the section containing the key to modify.key
- The name of the key key to modify or default key if not specified.value
- The new value of the key under modification.public static void setKeyValue(character section, java.lang.String key, java.lang.String value)
section
- The name of the section containing the key to modify.key
- The name of the key key to modify or default key if not specified.value
- The new value of the key under modification.public static void setKeyValue(java.lang.String section, java.lang.String key, character value)
section
- The name of the section containing the key to modify.key
- The name of the key key to modify or default key if not specified.value
- The new value of the key under modification.public static void setKeyValue(java.lang.String section, character key, java.lang.String value)
section
- The name of the section containing the key to modify.key
- The name of the key key to modify or default key if not specified.value
- The new value of the key under modification.public static void setKeyValue(java.lang.String section, java.lang.String key, java.lang.String value)
section
- The name of the section containing the key to modify.key
- The name of the key key to modify or default key if not specified.value
- The new value of the key under modification.public static void setKeyValue(character section, character key, character value)
section
- The name of the section containing the key to modify.key
- The name of the key key to modify or default key if not specified.value
- The new value of the key under modification.public static character getKeyValue(character section)
section
- The name of the section containing the key to get.public static character getKeyValue(java.lang.String section)
section
- The name of the section containing the key to get.public static character getKeyValue(java.lang.String section, java.lang.String key)
section
- The name of the section containing the key to get.key
- The name of the key key to get or default key if not specified.public static character getKeyValue(character section, java.lang.String key)
section
- The name of the section containing the key to get.key
- The name of the key key to get or default key if not specified.public static character getKeyValue(java.lang.String section, character key)
section
- The name of the section containing the key to get.key
- The name of the key key to get or default key if not specified.public static character getKeyValue(character section, character key)
section
- The name of the section containing the key to get.key
- The name of the key key to get or default key if not specified.public static void unload(java.lang.String env)
env
- The environment to unload. Can be the registry or initialization
file. The environment to unload should be previously loaded by
load() method.public static void unload(character env)
env
- The environment to unload. Can be the registry or initialization
file. The environment to unload should be previously loaded by
load() method.public static java.lang.String getCurrentEnvironmentName()
null
value.public static java.lang.String getLegacyPlatform()
Sometimes we need to specify a legacy platform regarding the real platform on which the clients actually runs. @link ColorSpec#convert. By default the client legacy platform is the same as OPSYS built-in returned value in Progress.
The value is read from server directory. If no value is set for legacy-system/opsys
then the returned value is the same as returned by the getOperatingSystem
call.
If set in the directory, the value of opsys MUST be UNIX or WIN32.
public static integer getProcessArchitecture()
static void addSourcePathListener(java.util.function.Consumer<java.lang.String> listener)
listener
- The listener to be notified.private static java.lang.String getClientOpSysName(EnvironmentOps.WorkArea wa)
getOperatingSystem()
method, but ending in
opsys/mapping/<lowercased_system_propert_name>
.
If no mapping is found, then an internal mapping table in this class is consulted. This table maps the following:
os.name Progress OPSYS ---------------- --------------- "linux" "UNIX" "aix" "UNIX" "solaris" "UNIX" "sunos" "UNIX" "hp-ux" "UNIX" "freebsd" "UNIX" "mac os x" "UNIX" "windows xp" "WIN32" "windows 2000" "WIN32" "windows nt" "WIN32" "windows me" "WIN32" "windows 98" "WIN32" "windows 95" "WIN32"
If there is no match, then any os.name
with the lowercase text "unix" will return
"UNIX" and any os.name
with the lowercase text "windows" will return "WIN32".
If there is still no match, the os.name
returned by Java will be returned.
wa
- Context-local work area.private static void onUse(java.lang.String envName)
USE environment
statement is executed.envName
- Environment name.private static void onUnload(java.lang.String envName)
UNLOAD environment
statement is executed.envName
- Environment name.private static boolean isIniType()
true
if INI file environment type.