3
* ====================================================================
4
* Licensed to the Apache Software Foundation (ASF) under one
5
* or more contributor license agreements. See the NOTICE file
6
* distributed with this work for additional information
7
* regarding copyright ownership. The ASF licenses this file
8
* to you under the Apache License, Version 2.0 (the
9
* "License"); you may not use this file except in compliance
10
* with the License. You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing,
15
* software distributed under the License is distributed on an
16
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
* KIND, either express or implied. See the License for the
18
* specific language governing permissions and limitations
20
* ====================================================================
24
package org.apache.subversion.javahl;
26
import org.apache.subversion.javahl.types.Tristate;
29
* Interface for manipulating the in-memory configuration info.
32
public interface ISVNConfig
35
* Returns a reference to the "config" configuration category.
40
* The following constants are section and option names from the
41
* "config" configuration file.
43
public static final String SECTION_AUTH = "auth";
44
public static final String PASSWORD_STORES = "password-stores";
45
public static final String KWALLET_WALLET = "kwallet-wallet";
46
public static final String KWALLET_SVN_APPLICATION_NAME_WITH_PID = "kwallet-svn-application-name-with-pid";
47
public static final String SSL_CLIENT_CERT_FILE_PROMPT = "ssl-client-cert-file-prompt";
49
public static final String SECTION_HELPERS = "helpers";
50
public static final String EDITOR_CMD = "editor-cmd";
51
public static final String DIFF_CMD = "diff-cmd";
52
public static final String DIFF_EXTENSIONS = "diff-extensions";
53
public static final String DIFF3_CMD = "diff3-cmd";
54
public static final String DIFF3_HAS_PROGRAM_ARG = "diff3-has-program-arg";
55
public static final String MERGE_TOOL_CMD = "merge-tool-cmd";
57
public static final String SECTION_MISCELLANY = "miscellany";
58
public static final String GLOBAL_IGNORES = "global-ignores";
59
public static final String LOG_ENCODING = "log-encoding";
60
public static final String USE_COMMIT_TIMES = "use-commit-times";
61
public static final String ENABLE_AUTO_PROPS = "enable-auto-props";
62
public static final String ENABLE_MAGIC_FILE = "enable-magic-file";
63
public static final String NO_UNLOCK = "no-unlock";
64
public static final String MIMETYPES_FILE = "mime-types-file";
65
public static final String PRESERVED_CF_EXTS = "preserved-conflict-file-exts";
66
public static final String INTERACTIVE_CONFLICTS = "interactive-conflicts";
67
public static final String MEMORY_CACHE_SIZE = "memory-cache-size";
68
public static final String DIFF_IGNORE_CONTENT_TYPE = "diff-ignore-content-type";
70
public static final String SECTION_TUNNELS = "tunnels";
72
public static final String SECTION_AUTO_PROPS = "auto-props";
74
public static final String SECTION_WORKING_COPY = "working-copy";
75
public static final String SQLITE_EXCLUSIVE = "exclusive-locking";
76
public static final String SQLITE_EXCLUSIVE_CLIENTS = "exclusive-locking-clients";
77
public static final String SQLITE_BUSY_TIMEOUT = "busy-timeout";
80
* Returns a reference to the "servers" configuration category.
85
* The following constants are section and option names from the
86
* "servers" configuration file.
88
public static final String SECTION_GROUPS = "groups";
89
public static final String SECTION_GLOBAL = "global";
91
public static final String HTTP_PROXY_HOST = "http-proxy-host";
92
public static final String HTTP_PROXY_PORT = "http-proxy-port";
93
public static final String HTTP_PROXY_USERNAME = "http-proxy-username";
94
public static final String HTTP_PROXY_PASSWORD = "http-proxy-password";
95
public static final String HTTP_PROXY_EXCEPTIONS = "http-proxy-exceptions";
96
public static final String HTTP_TIMEOUT = "http-timeout";
97
public static final String HTTP_COMPRESSION = "http-compression";
98
public static final String NEON_DEBUG_MASK = "neon-debug-mask";
99
public static final String HTTP_AUTH_TYPES = "http-auth-types";
100
public static final String SSL_AUTHORITY_FILES = "ssl-authority-files";
101
public static final String SSL_TRUST_DEFAULT_CA = "ssl-trust-default-ca";
102
public static final String SSL_CLIENT_CERT_FILE = "ssl-client-cert-file";
103
public static final String SSL_CLIENT_CERT_PASSWORD = "ssl-client-cert-password";
104
public static final String SSL_PKCS11_PROVIDER = "ssl-pkcs11-provider";
105
public static final String HTTP_LIBRARY = "http-library";
106
public static final String STORE_PASSWORDS = "store-passwords";
107
public static final String STORE_PLAINTEXT_PASSWORDS = "store-plaintext-passwords";
108
public static final String STORE_AUTH_CREDS = "store-auth-creds";
109
public static final String STORE_SSL_CLIENT_CERT_PP = "store-ssl-client-cert-pp";
110
public static final String STORE_SSL_CLIENT_CERT_PP_PLAINTEXT = "store-ssl-client-cert-pp-plaintext";
111
public static final String USERNAME = "username";
112
public static final String HTTP_BULK_UPDATES = "http-bulk-updates";
113
public static final String HTTP_MAX_CONNECTIONS = "http-max-connections";
114
public static final String HTTP_CHUNKED_REQUESTS = "http-chunked-requests";
115
public static final String SERF_LOG_COMPONENTS = "serf-log-components";
116
public static final String SERF_LOG_LEVEL = "serf-log-level";
119
* "true" value in configuration. One of the values returned by
120
* {@link Category#getYesNoAsk}.
122
public static final String TRUE = "TRUE";
125
* "false" value in configuration. One of the values returned by
126
* {@link Category#getYesNoAsk}.
128
public static final String FALSE = "FALSE";
131
* "ask" value in configuration. One of the values returned by
132
* {@link Category#getYesNoAsk}.
134
public static final String ASK = "ASK";
137
* Interface for reading and modifying configuration
138
* categories. Returned by {@link #config()} and
139
* {@link #servers()}.
141
public interface Category
144
* Returns the value of a configuration option.
145
* @param section The section name
146
* @param option The option name
147
* @param defaultValue Return this if the option was not found.
149
String get(String section,
151
String defaultValue);
154
* Returns the boolean value of a configuration option. The
155
* recognized representations are 'true'/'false', 'yes'/'no',
156
* 'on'/'off', '1'/'0'; case does not matter.
157
* @throws ClientException if the value cannot be parsed.
158
* @see #get(String,String,String)
160
boolean get(String section,
162
boolean defaultValue)
163
throws ClientException;
166
* Returns the long integer value of a configuration option.
167
* @see #get(String,String,boolean)
169
long get(String section,
172
throws ClientException;
175
* Returns the {@link Tristate} value of a configuration option.
176
* @param unknown The value used for {@link Tristate#Unknown}.
177
* @see #get(String,String,boolean)
179
Tristate get(String section,
182
Tristate defaultValue)
183
throws ClientException;
186
* Check that the configuration option's value is true, false
187
* or "ask". The boolean representations are the same as those
188
* understood by {@link #get(String,String,boolean)}. If the
189
* option is not found, the default value will be parsed
191
* @return {@link ISVNConfig#TRUE}, {@link ISVNConfig#FALSE}
192
* or {@link ISVNConfig#ASK}
193
* @throws ClientException if the either the value or the
194
* default cannot be parsed.
196
String getYesNoAsk(String section,
199
throws ClientException;
202
* Set the value of a configuration option.
203
* @param section The section name
204
* @param option The option name
205
* @param value The value to set the option to; passing
206
* <code>null</code> will delete the option.
208
void set(String section,
213
* Set the value of a configuration option to represent a boolean.
214
* @see #set(String,String,String)
216
void set(String section,
221
* Set the value of a configuration option to represent a long integer.
222
* @see #set(String,String,String)
224
void set(String section,
229
* @return the names of all the sections in the
230
* configuration category.
232
Iterable<String> sections();
235
* Call <code>handler</code> once for each option in the
236
* configuration category.
238
void enumerate(String section, Enumerator handler);
242
* Interface for {@link Category#enumerate} callback handlers.
244
public interface Enumerator
246
void option(String name, String value);