Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /*
2 * ====================================================================
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 * ====================================================================
20 *
21 * This software consists of voluntary contributions made by many
22 * individuals on behalf of the Apache Software Foundation. For more
23 * information on the Apache Software Foundation, please see
24 * <http://www.apache.org/>.
25 *
26 */
28 package ch.boye.httpclientandroidlib.client.params;
30 import java.util.Collection;
32 import ch.boye.httpclientandroidlib.annotation.NotThreadSafe;
34 import ch.boye.httpclientandroidlib.Header;
35 import ch.boye.httpclientandroidlib.HttpHost;
36 import ch.boye.httpclientandroidlib.conn.ClientConnectionManagerFactory;
37 import ch.boye.httpclientandroidlib.params.HttpAbstractParamBean;
38 import ch.boye.httpclientandroidlib.params.HttpParams;
40 /**
41 * This is a Java Bean class that can be used to wrap an instance of
42 * {@link HttpParams} and manipulate HTTP client parameters using
43 * Java Beans conventions.
44 *
45 * @since 4.0
46 */
47 @NotThreadSafe
48 public class ClientParamBean extends HttpAbstractParamBean {
50 public ClientParamBean (final HttpParams params) {
51 super(params);
52 }
54 public void setConnectionManagerFactoryClassName (final String factory) {
55 params.setParameter(ClientPNames.CONNECTION_MANAGER_FACTORY_CLASS_NAME, factory);
56 }
58 @Deprecated
59 public void setConnectionManagerFactory(ClientConnectionManagerFactory factory) {
60 params.setParameter(ClientPNames.CONNECTION_MANAGER_FACTORY, factory);
61 }
63 public void setHandleRedirects (final boolean handle) {
64 params.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, handle);
65 }
67 public void setRejectRelativeRedirect (final boolean reject) {
68 params.setBooleanParameter(ClientPNames.REJECT_RELATIVE_REDIRECT, reject);
69 }
71 public void setMaxRedirects (final int maxRedirects) {
72 params.setIntParameter(ClientPNames.MAX_REDIRECTS, maxRedirects);
73 }
75 public void setAllowCircularRedirects (final boolean allow) {
76 params.setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, allow);
77 }
79 public void setHandleAuthentication (final boolean handle) {
80 params.setBooleanParameter(ClientPNames.HANDLE_AUTHENTICATION, handle);
81 }
83 public void setCookiePolicy (final String policy) {
84 params.setParameter(ClientPNames.COOKIE_POLICY, policy);
85 }
87 public void setVirtualHost (final HttpHost host) {
88 params.setParameter(ClientPNames.VIRTUAL_HOST, host);
89 }
91 public void setDefaultHeaders (final Collection <Header> headers) {
92 params.setParameter(ClientPNames.DEFAULT_HEADERS, headers);
93 }
95 public void setDefaultHost (final HttpHost host) {
96 params.setParameter(ClientPNames.DEFAULT_HOST, host);
97 }
99 }