01: /*
02: * ====================================================================
03: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
04: *
05: * This software is licensed as described in the file COPYING, which
06: * you should have received as part of this distribution. The terms
07: * are also available at http://svnkit.com/license.html
08: * If newer versions of this license are posted there, you may use a
09: * newer version instead, at your option.
10: * ====================================================================
11: */
12: package org.tmatesoft.svn.core.internal.wc.admin;
13:
14: import java.util.HashMap;
15: import java.util.Map;
16:
17: import org.tmatesoft.svn.core.SVNException;
18:
19: /**
20: * @version 1.1.1
21: * @author TMate Software Ltd.
22: */
23: public class SVNProperties13 extends SVNVersionedProperties {
24:
25: public SVNProperties13(Map properties) {
26: super (properties);
27: }
28:
29: public boolean containsProperty(String name) throws SVNException {
30: if (!isEmpty()) {
31: Map props = loadProperties();
32: return props.containsKey(name);
33: }
34: return false;
35: }
36:
37: public String getPropertyValue(String name) throws SVNException {
38: if (getPropertiesMap() != null
39: && getPropertiesMap().containsKey(name)) {
40: return (String) getPropertiesMap().get(name);
41: }
42: if (!isEmpty()) {
43: Map props = loadProperties();
44: return (String) props.get(name);
45: }
46: return null;
47: }
48:
49: protected Map loadProperties() throws SVNException {
50: Map props = getPropertiesMap();
51: if (props == null) {
52: props = new HashMap();
53: setPropertiesMap(props);
54: }
55: return props;
56: }
57:
58: protected SVNVersionedProperties wrap(Map properties) {
59: return new SVNProperties13(properties);
60: }
61: }
|