Mercurial > hg4j
comparison src/org/tmatesoft/hg/internal/ConfigFile.java @ 487:db48a77ec8ff
Access to reposiotry lock mechanism via HgRepositoryLock
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 13 Aug 2012 18:11:47 +0200 |
parents | e31e85cf4d4c |
children | 0205a5c4566b |
comparison
equal
deleted
inserted
replaced
486:d740edfff563 | 487:db48a77ec8ff |
---|---|
89 public String getString(String sectionName, String key, String defaultValue) { | 89 public String getString(String sectionName, String key, String defaultValue) { |
90 String value = getSection(sectionName).get(key); | 90 String value = getSection(sectionName).get(key); |
91 return value == null ? defaultValue : value; | 91 return value == null ? defaultValue : value; |
92 } | 92 } |
93 | 93 |
94 public int getInteger(String sectionName, String key, int defaultValue) { | |
95 String value = getSection(sectionName).get(key); | |
96 return value == null ? defaultValue : Integer.parseInt(value); | |
97 } | |
98 | |
94 public void putString(String sectionName, String key, String newValue) { | 99 public void putString(String sectionName, String key, String newValue) { |
95 Map<String, String> section = null; | 100 Map<String, String> section = null; |
96 if (sections == null) { | 101 if (sections == null) { |
97 // init, in case we didn't read any file with prev config | 102 // init, in case we didn't read any file with prev config |
98 sections = new ArrayList<String>(); | 103 sections = new ArrayList<String>(); |