Classes in this File | Line Coverage | Branch Coverage | Complexity | |||||||
XmlRpcConfigImpl |
|
| 1.0;1 |
1 | /* |
|
2 | * Copyright 1999,2005 The Apache Software Foundation. |
|
3 | * |
|
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 | * you may not use this file except in compliance with the License. |
|
6 | * You may obtain a copy of the License at |
|
7 | * |
|
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
9 | * |
|
10 | * Unless required by applicable law or agreed to in writing, software |
|
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 | * See the License for the specific language governing permissions and |
|
14 | * limitations under the License. |
|
15 | */ |
|
16 | package org.apache.xmlrpc; |
|
17 | ||
18 | import org.apache.xmlrpc.common.XmlRpcHttpConfig; |
|
19 | ||
20 | ||
21 | /** Default implementation of {@link org.apache.xmlrpc.XmlRpcConfig}. |
|
22 | */ |
|
23 | 1199 | public abstract class XmlRpcConfigImpl implements XmlRpcConfig, XmlRpcHttpConfig { |
24 | private boolean enabledForExtensions; |
|
25 | private boolean contentLengthOptional; |
|
26 | private String basicEncoding; |
|
27 | private String encoding; |
|
28 | ||
29 | 2705 | public boolean isEnabledForExtensions() { return enabledForExtensions; } |
30 | ||
31 | /** Sets, whether extensions are enabled. By default, the |
|
32 | * client or server is strictly compliant to the XML-RPC |
|
33 | * specification and extensions are disabled. |
|
34 | * @param pExtensions True to enable extensions, false otherwise. |
|
35 | */ |
|
36 | public void setEnabledForExtensions(boolean pExtensions) { |
|
37 | 616 | enabledForExtensions = pExtensions; |
38 | 616 | } |
39 | ||
40 | /** Sets the encoding for basic authentication. |
|
41 | * @param pEncoding The encoding; may be null, in which case |
|
42 | * UTF-8 is choosen. |
|
43 | */ |
|
44 | public void setBasicEncoding(String pEncoding) { |
|
45 | 245 | basicEncoding = pEncoding; |
46 | 245 | } |
47 | ||
48 | 533 | public String getBasicEncoding() { return basicEncoding; } |
49 | ||
50 | /** Sets the requests encoding. |
|
51 | * @param pEncoding The requests encoding or null (default |
|
52 | * UTF-8). |
|
53 | */ |
|
54 | public void setEncoding(String pEncoding) { |
|
55 | 70 | encoding = pEncoding; |
56 | 70 | } |
57 | ||
58 | 664 | public String getEncoding() { return encoding; } |
59 | ||
60 | public boolean isContentLengthOptional() { |
|
61 | 739 | return contentLengthOptional; |
62 | } |
|
63 | ||
64 | /** Sets, whether a "Content-Length" header may be |
|
65 | * omitted. The XML-RPC specification demands, that such |
|
66 | * a header be present. |
|
67 | * @param pContentLengthOptional True, if the content length may be omitted. |
|
68 | */ |
|
69 | public void setContentLengthOptional(boolean pContentLengthOptional) { |
|
70 | 735 | contentLengthOptional = pContentLengthOptional; |
71 | 735 | } |
72 | } |