Class StarterConfig
- java.lang.Object
-
- com._1c.g5.v8.dt.platform.services.core.StarterConfig
-
public final class StarterConfig extends Object
1C:Enterprise Starter config. 1C:Enterprise Starter configs are*.cfg
system files with properties. Starter application uses configs to hold information about infobases references locations, template locations etc. Configs can refer to other configs withCOMMON_CONFIG_LOCATION
property to provide combined properties.Config property entries are not unique: multiple entries with same keys are allowed. Order of values with the same key is also important.
Example of config file:
CommonCfgLocation=\\some\server\folder1\1CESCmn.cfg CommonInfoBases=\\some\server\folder2\ibcommon.v8i ConfigurationTemplatesLocation=C:\Users\UserName\AppData\Roaming\\1C\1cv8\tmplts ConfigurationTemplatesLocation=D:\AnotherTemplates\ UseHWLicenses=1 AppAutoInstallLastVersion=1 DefaultVersion=8.3
StarterConfig
contains methods to parse and write 1C:Enterprise Starter config properties. Parse methods allows to pass multiple config files as parameters, cause there may be many of them. Also containsString
keys constants.Example of usage:
Collection<Path> commonInfobasesFiles = StarterConfig.parsePathProperty(StarterConfig.COMMON_INFOBASES, Paths.get("C:\Path\To\1CEStart\1CEStart.cfg")); allInfobasesFiles.add(commonInfobasesFiles); parseInfobasesFiles(allInfobasesFiles);
- Restriction:
- This class is not intended to be sub-classed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLCATION_AUTO_INSTALL_LAST_VERSION
Flag of auto install last version of 1C:Enterprise property.static String
COMMON_CONFIG_LOCATION
Common 1C:Enterprise Starter config location property.static String
COMMON_INFOBASES
Common infobases config location property.static String
CONFIGURATION_TEMPLATES_LOCATION
Common infobase templates location property.static String
DEFAULT_VERSION
Default version mask of 1C:Enterprise to use property.static String
DISTRIBUTIVE_LOCATION
Path to auto search 1C:Enterprise runtime distributives.static String
FALSE
String
-encodedfalse
value.static String
INSTALLED_LOCATION
Path with 1C:Enterprise runtime installations.static String
INTERNET_SERVICE
URL of web service that provides common infobases and 1C:Enterprise runtime distributives.static String
TRUE
String
-encodedtrue
value.static String
USE_HARDWARE_LICENSES
Flag of using hardware licenses property.static String
WEB_COMMON_INFOBASES
URL of web service that provides common infobases.static String
WEB_DISTRIBUTIVE_LOCATION
URL of web service that provides 1C:Enterprise runtime distributives.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Path[]
appendCommonConfigs(Path... configLocations)
Append common 1C:Enterprise Starter configs to the given configs by theCOMMON_CONFIG_LOCATION
property in the given configs.static Optional<Boolean>
parseBooleanProperty(String key, Path... configLocations)
Parse singleboolean
property from 1C:Enterprise Starter config files.static List<Path>
parsePathProperty(String key, Path... configLocations)
Parse singlePath
property from 1C:Enterprise Starter config files.static Map<String,List<String>>
parseProperties(Path... configLocations)
Parse 1C:Enterprise Starter config files to the properties map.static List<String>
parseProperty(String key, Path... configLocations)
Parse single property from 1C:Enterprise Starter config files.static void
writeBooleanProperty(String key, boolean value, Path configLocation)
Write singleboolean
property with the givenkey
to the given 1C:Enterprise Starter config.static void
writePathProperty(String key, List<Path> value, Path configLocation)
Write singlePath
property with the givenkey
to the given 1C:Enterprise Starter config.static void
writeProperties(Map<String,List<String>> properties, Path configLocation)
Write the givenproperties
to the given 1C:Enterprise Starter config.static void
writeProperty(String key, List<String> value, Path configLocation)
Write single property with the givenkey
to the given 1C:Enterprise Starter config.
-
-
-
Field Detail
-
COMMON_CONFIG_LOCATION
public static final String COMMON_CONFIG_LOCATION
Common 1C:Enterprise Starter config location property. Value isPath
to the common 1C:Enterprise Starter config location.- See Also:
- Constant Field Values
-
COMMON_INFOBASES
public static final String COMMON_INFOBASES
Common infobases config location property. Value isPath
to the common infobases config location.- See Also:
- Constant Field Values
-
DEFAULT_VERSION
public static final String DEFAULT_VERSION
Default version mask of 1C:Enterprise to use property. Value isString
mask of 1C:Enterprise version with build or versions correspondence.- See Also:
- Constant Field Values
-
INSTALLED_LOCATION
public static final String INSTALLED_LOCATION
Path with 1C:Enterprise runtime installations. Value isPath
to 1C:Enterprise runtime installations folder.- See Also:
- Constant Field Values
-
DISTRIBUTIVE_LOCATION
public static final String DISTRIBUTIVE_LOCATION
Path to auto search 1C:Enterprise runtime distributives. Value isPath
to distributives folder.- See Also:
- Constant Field Values
-
CONFIGURATION_TEMPLATES_LOCATION
public static final String CONFIGURATION_TEMPLATES_LOCATION
Common infobase templates location property. Value isPath
to the common infobases templates location.- See Also:
- Constant Field Values
-
USE_HARDWARE_LICENSES
public static final String USE_HARDWARE_LICENSES
Flag of using hardware licenses property. Value is one of:0
or1
.- See Also:
- Constant Field Values
-
INTERNET_SERVICE
public static final String INTERNET_SERVICE
URL of web service that provides common infobases and 1C:Enterprise runtime distributives.- See Also:
- Constant Field Values
-
WEB_COMMON_INFOBASES
public static final String WEB_COMMON_INFOBASES
URL of web service that provides common infobases.- See Also:
- Constant Field Values
-
WEB_DISTRIBUTIVE_LOCATION
public static final String WEB_DISTRIBUTIVE_LOCATION
URL of web service that provides 1C:Enterprise runtime distributives.- See Also:
- Constant Field Values
-
APPLCATION_AUTO_INSTALL_LAST_VERSION
public static final String APPLCATION_AUTO_INSTALL_LAST_VERSION
Flag of auto install last version of 1C:Enterprise property. Value is one of:0
or1
.- See Also:
- Constant Field Values
-
TRUE
public static final String TRUE
String
-encodedtrue
value. Vaue is1
.- See Also:
- Constant Field Values
-
FALSE
public static final String FALSE
String
-encodedfalse
value. Vaue is0
.- See Also:
- Constant Field Values
-
-
Method Detail
-
appendCommonConfigs
public static Path[] appendCommonConfigs(Path... configLocations) throws IOException
Append common 1C:Enterprise Starter configs to the given configs by theCOMMON_CONFIG_LOCATION
property in the given configs.- Parameters:
configLocations
- locations of 1C:Enterprise Starter configs, cannot benull
- Returns:
configLocations
with appended common 1C:Enterprise Starter configs, nevernull
- Throws:
IOException
- if config parse I/O error occurred
-
parseProperties
public static Map<String,List<String>> parseProperties(Path... configLocations) throws IOException
Parse 1C:Enterprise Starter config files to the properties map. Properties of the multiple configs will be combined.Property entries are not unique.- Parameters:
configLocations
- locations of 1C:Enterprise Starter configs, cannot benull
- Returns:
- combined properties map, never
null
- Throws:
IOException
- if config parse I/O error occurred
-
parseProperty
public static List<String> parseProperty(String key, Path... configLocations) throws IOException
Parse single property from 1C:Enterprise Starter config files. Property value of the multiple configs will be combined.- Parameters:
key
- the property key, cannot benull
configLocations
- locations of 1C:Enterprise Starter configs, cannot benull
- Returns:
- the values ordered list, never
null
- Throws:
IOException
- if config parse I/O error occurred
-
parsePathProperty
public static List<Path> parsePathProperty(String key, Path... configLocations) throws IOException
Parse singlePath
property from 1C:Enterprise Starter config files. Property value of the multiple configs will be combined.- Parameters:
key
- the property key, cannot benull
configLocations
- locations of 1C:Enterprise Starter configs, cannot benull
- Returns:
- the
Path
values ordered list, nevernull
- Throws:
IOException
- if config parse I/O error occurred
-
parseBooleanProperty
public static Optional<Boolean> parseBooleanProperty(String key, Path... configLocations) throws IOException
Parse singleboolean
property from 1C:Enterprise Starter config files.- Parameters:
key
- the property key, cannot benull
configLocations
- locations of 1C:Enterprise Starter configs, cannot benull
- Returns:
- the optional
boolean
value property - Throws:
IOException
- if config parse I/O error occurred
-
writeProperties
public static void writeProperties(Map<String,List<String>> properties, Path configLocation) throws IOException
Write the givenproperties
to the given 1C:Enterprise Starter config. All previous content will be overriden. Order of properties is important,LinkedHashMap
usage is recommended.- Parameters:
properties
- the properties map, cannot benull
configLocation
- the location of 1C:Enterprise Starter config to write to, cannot benull
- Throws:
IOException
- if config write I/O error occurred
-
writeProperty
public static void writeProperty(String key, List<String> value, Path configLocation) throws IOException
Write single property with the givenkey
to the given 1C:Enterprise Starter config. All other config content remains the same.- Parameters:
key
- the property key, cannot benull
value
- all values of the properties, cannot benull
, may be empty to erase property; order of values is importantconfigLocation
- the location of 1C:Enterprise Starter config to write to, cannot benull
- Throws:
IOException
- if config write I/O error occurred
-
writePathProperty
public static void writePathProperty(String key, List<Path> value, Path configLocation) throws IOException
Write singlePath
property with the givenkey
to the given 1C:Enterprise Starter config. All other config content remains the same.- Parameters:
key
- the property key, cannot benull
value
- all values of the properties, cannot benull
, may be empty to erase property; order of values is importantconfigLocation
- the location of 1C:Enterprise Starter config to write to, cannot benull
- Throws:
IOException
- if config write I/O error occurred
-
writeBooleanProperty
public static void writeBooleanProperty(String key, boolean value, Path configLocation) throws IOException
Write singleboolean
property with the givenkey
to the given 1C:Enterprise Starter config. All other config content remains the same.- Parameters:
key
- the property key, cannot benull
value
- all values of the properties, cannot benull
, may be empty to erase property; order of values is importantconfigLocation
- the location of 1C:Enterprise Starter config to write to, cannot benull
- Throws:
IOException
- if config write I/O error occurred
-
-