Package org.compiere.util
Class Ini
java.lang.Object
org.compiere.util.Ini
- All Implemented Interfaces:
Serializable
Load and Save INI Settings from property file (idempiere.properties).
Initiated in Adempiere.startup.
Initiated in Adempiere.startup.
- Version:
- $Id$
- Author:
- Jorg Janke, Teo Sarca, www.arhipac.ro
- FR [ 1658127 ] Select charset encoding on import
- FR [ 2406123 ] Ini.saveProperties fails if target directory does not exist
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final boolean
static final boolean
static final String
System environment prefixstatic final String
System Property Value of IDEMPIERE_HOMEstatic final String
Property file namestatic final String
Auto Savestatic final String
Auto Loginstatic final String
Auto New Recordstatic final String
Dictionary Maintenancestatic final String
Cache Windowsstatic final String
Charsetstatic final String
Client Namestatic final String
Connection Detailsstatic final String
Data Sourcestatic final String
Ini File Namestatic final String
Languagestatic final String
Load tab fields meta data using background threadstatic final String
Log Migration Scriptstatic final String
Open new windows as maximizedstatic final String
Org Namestatic final String
Printer Namestatic final String
Print Previewstatic final String
Apps Passwordstatic final String
Rolestatic final String
Show Acct Tabsstatic final String
Show Translation Tabsstatic final String
Single instance per window idstatic final String
Store Passwordstatic final String
Temp Directorystatic final String
Current Datestatic final String
Trace to Filestatic final String
Trace Levelstatic final String
Look and Feelstatic final String
UI Themestatic final String
Apps User IDstatic final String
Validate connection on startupstatic final String
Warehouse Name -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Delete Property filestatic String
Find iDempiere Homestatic String
Get iDempiere Home from Environmentstatic String
toStringstatic Charset[]
Get Available Encoding Charsetsstatic Charset
Get current charsetstatic int
Deprecated.static String
getFileName
(boolean tryUserHome) Return File Name of INI filestatic Properties
Get Propertiesstatic String
getProperty
(String key) Get Propertystatic String
Get property file namestatic String
Get value of a secret variablestatic Dimension
getWindowDimension
(int AD_Window_ID) Deprecated.static Point
getWindowLocation
(int AD_Window_ID) Deprecated.static boolean
Cache Windowsstatic boolean
isClient()
Are we in Client Mode ?static boolean
isLoaded()
Are the properties loaded?static boolean
isPropertyBool
(String key) Get Property as Booleanstatic boolean
Is show license dialog for new setupstatic void
loadProperties
(boolean reload) Load INI parameters from diskstatic boolean
loadProperties
(String filename) Load INI parameters from filename.static String
runCommand
(String[] command) Run shell commandstatic void
saveProperties
(boolean tryUserHome) Save INI parameters to diskstatic void
setAdempiereHome
(String idempiereHome) Set iDempiere Homestatic void
setClient
(boolean client) Set Client Modestatic void
setDividerLocation
(int dividerLocation) Deprecated.static void
setProperty
(String key, boolean value) Set Propertystatic void
setProperty
(String key, int value) Set Propertystatic void
setProperty
(String key, String value) Set Propertystatic void
setShowLicenseDialog
(boolean b) Set show license dialog for new setupstatic void
Set value of secret variablestatic void
setWindowDimension
(int AD_Window_ID, Dimension windowDimension) Deprecated.static void
setWindowLocation
(int AD_Window_ID, Point windowLocation) Deprecated.
-
Field Details
-
IDEMPIERE_PROPERTY_FILE
Property file name- See Also:
-
P_UID
Apps User ID- See Also:
-
P_PWD
Apps Password- See Also:
-
P_STORE_PWD
Store Password- See Also:
-
P_TRACELEVEL
Trace Level- See Also:
-
P_TRACEFILE
Trace to File- See Also:
-
P_LANGUAGE
Language- See Also:
-
P_INI
Ini File Name- See Also:
-
P_CONNECTION
Connection Details- See Also:
-
P_CONTEXT
Data Source- See Also:
-
P_UI_LOOK
Look and Feel- See Also:
-
P_UI_THEME
UI Theme- See Also:
-
P_A_COMMIT
Auto Save- See Also:
-
P_A_LOGIN
Auto Login- See Also:
-
P_A_NEW
Auto New Record- See Also:
-
P_ADEMPIERESYS
Dictionary Maintenance- See Also:
-
P_LOGMIGRATIONSCRIPT
Log Migration Script- See Also:
-
P_SHOW_ACCT
Show Acct Tabs- See Also:
-
P_SHOW_TRL
Show Translation Tabs- See Also:
-
P_CACHE_WINDOW
Cache Windows- See Also:
-
P_TEMP_DIR
Temp Directory- See Also:
-
P_ROLE
Role- See Also:
-
P_CLIENT
Client Name- See Also:
-
P_ORG
Org Name- See Also:
-
P_PRINTER
Printer Name- See Also:
-
P_WAREHOUSE
Warehouse Name- See Also:
-
P_TODAY
Current Date- See Also:
-
P_PRINTPREVIEW
Print Preview- See Also:
-
P_VALIDATE_CONNECTION_ON_STARTUP
Validate connection on startup- See Also:
-
P_SINGLE_INSTANCE_PER_WINDOW
Single instance per window id- See Also:
-
DEFAULT_SINGLE_INSTANCE_PER_WINDOW
public static final boolean DEFAULT_SINGLE_INSTANCE_PER_WINDOW- See Also:
-
P_OPEN_WINDOW_MAXIMIZED
Open new windows as maximized- See Also:
-
DEFAULT_OPEN_WINDOW_MAXIMIZED
public static final boolean DEFAULT_OPEN_WINDOW_MAXIMIZED- See Also:
-
P_CHARSET
Charset- See Also:
-
P_LOAD_TAB_META_DATA_BG
Load tab fields meta data using background thread- See Also:
-
DEFAULT_LOAD_TAB_META_DATA_BG
- See Also:
-
ENV_PREFIX
System environment prefix- See Also:
-
IDEMPIERE_HOME
System Property Value of IDEMPIERE_HOME- See Also:
-
-
Constructor Details
-
Ini
public Ini()
-
-
Method Details
-
saveProperties
public static void saveProperties(boolean tryUserHome) Save INI parameters to disk- Parameters:
tryUserHome
- true to try user home first
-
loadProperties
public static void loadProperties(boolean reload) Load INI parameters from disk- Parameters:
reload
- reload
-
loadProperties
Load INI parameters from filename. Logger is on default level (INFO)- Parameters:
filename
- to load- Returns:
- true if first time
-
deletePropertyFile
public static void deletePropertyFile()Delete Property file -
getFileName
Return File Name of INI fileExamples: C:\WinNT\Profiles\jjanke\idempiere.properties D:\idempiere\idempiere.properties idempiere.properties
Can be overwritten by -DPropertyFile=myFile allowing multiple configurations / property files.- Parameters:
tryUserHome
- true to try user home first, ignore for server- Returns:
- file name
-
setProperty
Set Property- Parameters:
key
- Keyvalue
- Value
-
setProperty
Set Property- Parameters:
key
- Keyvalue
- Value
-
setProperty
Set Property- Parameters:
key
- Keyvalue
- Value
-
getProperty
Get Property- Parameters:
key
- Key- Returns:
- Value
-
isPropertyBool
Get Property as Boolean- Parameters:
key
- Key- Returns:
- Value
-
isCacheWindow
public static boolean isCacheWindow()Cache Windows- Returns:
- true if windows are cached
-
getProperties
Get Properties- Returns:
- Ini properties
-
getAsString
toString- Returns:
- String representation
-
isClient
public static boolean isClient()Are we in Client Mode ?- Returns:
- true if client
-
setClient
public static void setClient(boolean client) Set Client Mode- Parameters:
client
- client
-
setShowLicenseDialog
public static void setShowLicenseDialog(boolean b) Set show license dialog for new setup- Parameters:
b
-
-
isShowLicenseDialog
public static boolean isShowLicenseDialog()Is show license dialog for new setup- Returns:
- boolean
-
isLoaded
public static boolean isLoaded()Are the properties loaded?- Returns:
- true if properties loaded.
-
getAdempiereHome
Get iDempiere Home from Environment- Returns:
- idempiereHome or null
-
setAdempiereHome
Set iDempiere Home- Parameters:
idempiereHome
- IDEMPIERE_HOME
-
findAdempiereHome
Find iDempiere Home- Returns:
- idempiere home or null
-
getWindowDimension
Deprecated.Get Window Dimension- Parameters:
AD_Window_ID
- window no- Returns:
- dimension or null
-
setWindowDimension
Deprecated.Set Window Dimension- Parameters:
AD_Window_ID
- windowwindowDimension
- dimension - null to remove
-
getWindowLocation
Deprecated.Get Window Location- Parameters:
AD_Window_ID
- window id- Returns:
- location or null
-
setWindowLocation
Deprecated.Set Window Location- Parameters:
AD_Window_ID
- windowwindowLocation
- location - null to remove
-
getDividerLocation
Deprecated.Get Divider Location- Returns:
- location
-
setDividerLocation
Deprecated.Set Divider Location- Parameters:
dividerLocation
- location
-
getAvailableCharsets
Get Available Encoding Charsets- Returns:
- array of available encoding charsets
- Since:
- 3.1.4
-
getCharset
Get current charset- Returns:
- current charset
- Since:
- 3.1.4
-
getPropertyFileName
Get property file name- Returns:
- property file name
-
getVar
Get value of a secret variable- Parameters:
secretVar
- secret variable name- Returns:
- value of secret variable
-
setVar
Set value of secret variable- Parameters:
secretVar
-secretValue
-
-
runCommand
Run shell command- Parameters:
command
-- Returns:
- command output
-