/** * Returns autoproperties as a {@link java.util.Map} * where each key is a file name pattern and the corresponding * value is a string in the form of <code>"propName=propValue"</code>. * * @return a {@link java.util.Map} containing autoproperties */ public Map getAutoProperties() { return getConfigFile().getProperties(AUTOPROPS_GROUP); }
@Override public String get(String section, String option, String defaultValue) { final String propertyValue = configFile.getPropertyValue(section, option); return propertyValue == null ? defaultValue : propertyValue; }
@Override public void set(String section, String option, String value) { configFile.setPropertyValue(section, option, value, true); }
protected SVNCompositeConfigFile getServersFile() { if (myServersFile == null) { SVNConfigFile userConfig = new SVNConfigFile(new File(myConfigDirectory, "servers")); SVNConfigFile systemConfig = new SVNConfigFile(new File(SVNFileUtil.getSystemConfigurationDirectory(), "servers")); myServersFile = new SVNCompositeConfigFile(systemConfig, userConfig); myServersFile.setGroupsToOptions(myServersOptions); if (myConfigEventHandler != null) { myConfigEventHandler.onLoad(null, myServersFile); } } return myServersFile; }
continue; getConfigFile().setPropertyValue(AUTOPROPS_GROUP, pattern, null, false); names.remove(); continue; getConfigFile().setPropertyValue(AUTOPROPS_GROUP, pattern, value, false); getConfigFile().save();
public void setInMemoryConfigOptions(Map configOptions) { myConfigOptions = configOptions; if (myConfigFile != null) { myConfigFile.setGroupsToOptions(myConfigOptions); } }
@Override public Iterable<String> sections() { return configFile.getGroupNames(); }
protected SVNCompositeConfigFile getServersFile() { if (myServersFile == null) { SVNConfigFile.createDefaultConfiguration(myConfigDirectory); SVNConfigFile userConfig = new SVNConfigFile(new File(myConfigDirectory, "servers")); SVNConfigFile systemConfig = new SVNConfigFile(new File(SVNFileUtil.getSystemConfigurationDirectory(), "servers")); myServersFile = new SVNCompositeConfigFile(systemConfig, userConfig); myServersFile.setGroupsToOptions(myServersOptions); } return myServersFile; }
continue; getConfigFile().setPropertyValue(AUTOPROPS_GROUP, pattern, null, false); names.remove(); continue; getConfigFile().setPropertyValue(AUTOPROPS_GROUP, pattern, value, false); getConfigFile().save();
public void setInMemoryConfigOptions(Map configOptions) { myConfigOptions = configOptions; if (myConfigFile != null) { myConfigFile.setGroupsToOptions(myConfigOptions); } }
@Override public String getYesNoAsk(String section, String option, String defaultValue) throws ClientException { final String propertyValue = configFile.getPropertyValue(section, option); return propertyValue == null ? defaultValue : propertyValue; }
@Override public void set(String section, String option, boolean value) { configFile.setPropertyValue(section, option, String.valueOf(value), true); }
private SVNCompositeConfigFile getConfigFile() { if (myConfigFile == null) { SVNConfigFile.createDefaultConfiguration(myConfigDirectory); SVNConfigFile userConfig = new SVNConfigFile(new File(myConfigDirectory, "config")); SVNConfigFile systemConfig = new SVNConfigFile(new File(SVNFileUtil.getSystemConfigurationDirectory(), "config")); myConfigFile = new SVNCompositeConfigFile(systemConfig, userConfig); myConfigFile.setGroupsToOptions(myConfigOptions); } return myConfigFile; }
@Override public void enumerate(String section, ISVNConfig.Enumerator handler) { final Map properties = configFile.getProperties(section); final Set<Map.Entry<String, String>> entrySet = properties.entrySet(); for (Map.Entry<String, String> entry : entrySet) { final String option = entry.getKey(); final String value = entry.getValue(); handler.option(option, value); } } }
continue; getConfigFile().setPropertyValue(AUTOPROPS_GROUP, pattern, null, false); names.remove(); continue; getConfigFile().setPropertyValue(AUTOPROPS_GROUP, pattern, value, false); getConfigFile().save();
@Override public long get(String section, String option, long defaultValue) throws ClientException { final String propertyValue = configFile.getPropertyValue(section, option); try { return propertyValue == null ? defaultValue : Long.parseLong(propertyValue); } catch (NumberFormatException e) { return defaultValue; } }
@Override public void set(String section, String option, long value) { configFile.setPropertyValue(section, option, String.valueOf(value), true); }
protected SVNCompositeConfigFile getServersFile() { if (myServersFile == null) { SVNConfigFile.createDefaultConfiguration(myConfigDirectory); SVNConfigFile userConfig = new SVNConfigFile(new File(myConfigDirectory, "servers")); SVNConfigFile systemConfig = new SVNConfigFile(new File(SVNFileUtil.getSystemConfigurationDirectory(), "servers")); myServersFile = new SVNCompositeConfigFile(systemConfig, userConfig); myServersFile.setGroupsToOptions(myServersOptions); } return myServersFile; }
private String getDefaultSSHCommandLine() { Map tunnels = getConfigFile().getProperties("tunnels"); if (tunnels == null || !tunnels.containsKey("ssh")) { return null; } return (String) tunnels.get("ssh"); }
@Override public boolean get(String section, String option, boolean defaultValue) throws ClientException { final String propertyValue = configFile.getPropertyValue(section, option); return propertyValue == null ? defaultValue : TRUE_VALUES.contains(propertyValue.toLowerCase()); }