Mercurial > 510Connectbot
comparison src/ch/ethz/ssh2/HTTPProxyData.java @ 307:071eccdff8ea ganymed
fix java formatting
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 30 Jul 2014 14:16:58 -0700 |
parents | 91a31873c42a |
children |
comparison
equal
deleted
inserted
replaced
305:d2b303406d63 | 307:071eccdff8ea |
---|---|
4 */ | 4 */ |
5 package ch.ethz.ssh2; | 5 package ch.ethz.ssh2; |
6 | 6 |
7 /** | 7 /** |
8 * A <code>HTTPProxyData</code> object is used to specify the needed connection data | 8 * A <code>HTTPProxyData</code> object is used to specify the needed connection data |
9 * to connect through a HTTP proxy. | 9 * to connect through a HTTP proxy. |
10 * | 10 * |
11 * @see Connection#setProxyData(ProxyData) | 11 * @see Connection#setProxyData(ProxyData) |
12 * | 12 * |
13 * @author Christian Plattner | 13 * @author Christian Plattner |
14 * @version 2.50, 03/15/10 | 14 * @version 2.50, 03/15/10 |
15 */ | 15 */ |
16 | 16 |
17 public class HTTPProxyData implements ProxyData | 17 public class HTTPProxyData implements ProxyData { |
18 { | 18 public final String proxyHost; |
19 public final String proxyHost; | 19 public final int proxyPort; |
20 public final int proxyPort; | 20 public final String proxyUser; |
21 public final String proxyUser; | 21 public final String proxyPass; |
22 public final String proxyPass; | 22 public final String[] requestHeaderLines; |
23 public final String[] requestHeaderLines; | |
24 | 23 |
25 /** | 24 /** |
26 * Same as calling {@link #HTTPProxyData(String, int, String, String) HTTPProxyData(proxyHost, proxyPort, <code>null</code>, <code>null</code>)} | 25 * Same as calling {@link #HTTPProxyData(String, int, String, String) HTTPProxyData(proxyHost, proxyPort, <code>null</code>, <code>null</code>)} |
27 * | 26 * |
28 * @param proxyHost Proxy hostname. | 27 * @param proxyHost Proxy hostname. |
29 * @param proxyPort Proxy port. | 28 * @param proxyPort Proxy port. |
30 */ | 29 */ |
31 public HTTPProxyData(String proxyHost, int proxyPort) | 30 public HTTPProxyData(String proxyHost, int proxyPort) { |
32 { | 31 this(proxyHost, proxyPort, null, null); |
33 this(proxyHost, proxyPort, null, null); | 32 } |
34 } | |
35 | 33 |
36 /** | 34 /** |
37 * Same as calling {@link #HTTPProxyData(String, int, String, String, String[]) HTTPProxyData(proxyHost, proxyPort, <code>null</code>, <code>null</code>, <code>null</code>)} | 35 * Same as calling {@link #HTTPProxyData(String, int, String, String, String[]) HTTPProxyData(proxyHost, proxyPort, <code>null</code>, <code>null</code>, <code>null</code>)} |
38 * | 36 * |
39 * @param proxyHost Proxy hostname. | 37 * @param proxyHost Proxy hostname. |
40 * @param proxyPort Proxy port. | 38 * @param proxyPort Proxy port. |
41 * @param proxyUser Username for basic authentication (<code>null</code> if no authentication is needed). | 39 * @param proxyUser Username for basic authentication (<code>null</code> if no authentication is needed). |
42 * @param proxyPass Password for basic authentication (<code>null</code> if no authentication is needed). | 40 * @param proxyPass Password for basic authentication (<code>null</code> if no authentication is needed). |
43 */ | 41 */ |
44 public HTTPProxyData(String proxyHost, int proxyPort, String proxyUser, String proxyPass) | 42 public HTTPProxyData(String proxyHost, int proxyPort, String proxyUser, String proxyPass) { |
45 { | 43 this(proxyHost, proxyPort, proxyUser, proxyPass, null); |
46 this(proxyHost, proxyPort, proxyUser, proxyPass, null); | 44 } |
47 } | |
48 | 45 |
49 /** | 46 /** |
50 * Connection data for a HTTP proxy. It is possible to specify a username and password | 47 * Connection data for a HTTP proxy. It is possible to specify a username and password |
51 * if the proxy requires basic authentication. Also, additional request header lines can | 48 * if the proxy requires basic authentication. Also, additional request header lines can |
52 * be specified (e.g., "User-Agent: CERN-LineMode/2.15 libwww/2.17b3"). | 49 * be specified (e.g., "User-Agent: CERN-LineMode/2.15 libwww/2.17b3"). |
53 * <p> | 50 * <p> |
54 * Please note: if you want to use basic authentication, then both <code>proxyUser</code> | 51 * Please note: if you want to use basic authentication, then both <code>proxyUser</code> |
55 * and <code>proxyPass</code> must be non-null. | 52 * and <code>proxyPass</code> must be non-null. |
56 * <p> | 53 * <p> |
57 * Here is an example: | 54 * Here is an example: |
58 * <p> | 55 * <p> |
59 * <code> | 56 * <code> |
60 * new HTTPProxyData("192.168.1.1", "3128", "proxyuser", "secret", new String[] {"User-Agent: GanymedBasedClient/1.0", "X-My-Proxy-Option: something"}); | 57 * new HTTPProxyData("192.168.1.1", "3128", "proxyuser", "secret", new String[] {"User-Agent: GanymedBasedClient/1.0", "X-My-Proxy-Option: something"}); |
61 * </code> | 58 * </code> |
62 * | 59 * |
63 * @param proxyHost Proxy hostname. | 60 * @param proxyHost Proxy hostname. |
64 * @param proxyPort Proxy port. | 61 * @param proxyPort Proxy port. |
65 * @param proxyUser Username for basic authentication (<code>null</code> if no authentication is needed). | 62 * @param proxyUser Username for basic authentication (<code>null</code> if no authentication is needed). |
66 * @param proxyPass Password for basic authentication (<code>null</code> if no authentication is needed). | 63 * @param proxyPass Password for basic authentication (<code>null</code> if no authentication is needed). |
67 * @param requestHeaderLines An array with additional request header lines (without end-of-line markers) | 64 * @param requestHeaderLines An array with additional request header lines (without end-of-line markers) |
68 * that have to be sent to the server. May be <code>null</code>. | 65 * that have to be sent to the server. May be <code>null</code>. |
69 */ | 66 */ |
70 | 67 |
71 public HTTPProxyData(String proxyHost, int proxyPort, String proxyUser, String proxyPass, | 68 public HTTPProxyData(String proxyHost, int proxyPort, String proxyUser, String proxyPass, |
72 String[] requestHeaderLines) | 69 String[] requestHeaderLines) { |
73 { | 70 if (proxyHost == null) |
74 if (proxyHost == null) | 71 throw new IllegalArgumentException("proxyHost must be non-null"); |
75 throw new IllegalArgumentException("proxyHost must be non-null"); | |
76 | 72 |
77 if (proxyPort < 0) | 73 if (proxyPort < 0) |
78 throw new IllegalArgumentException("proxyPort must be non-negative"); | 74 throw new IllegalArgumentException("proxyPort must be non-negative"); |
79 | 75 |
80 this.proxyHost = proxyHost; | 76 this.proxyHost = proxyHost; |
81 this.proxyPort = proxyPort; | 77 this.proxyPort = proxyPort; |
82 this.proxyUser = proxyUser; | 78 this.proxyUser = proxyUser; |
83 this.proxyPass = proxyPass; | 79 this.proxyPass = proxyPass; |
84 this.requestHeaderLines = requestHeaderLines; | 80 this.requestHeaderLines = requestHeaderLines; |
85 } | 81 } |
86 } | 82 } |