public class ProxySetting extends Object
Modifier and Type | Field and Description |
---|---|
static int |
PROTOCOL_ALL
Indicates the settings will affect all protocols.
|
static int |
PROTOCOL_FTP
Indicates the settings will be used for the file transfer protocol.
|
static int |
PROTOCOL_GOPHER
Indicates the settings will be used for the gopher protocol.
|
static int |
PROTOCOL_HTTP
Indicates the settings will be used for the hypertext transfer protocol.
|
static int |
PROTOCOL_HTTPS
Indicates the settings will be used for the secure hypertext transfer
protocol.
|
static int |
PROTOCOL_SOCKS
Indicates the settings will be used for the socks server protocol.
|
Constructor and Description |
---|
ProxySetting()
Constructor for ProxySetting.
|
ProxySetting(int protocol,
String server,
int port)
Constructor for ProxySetting with initial settings.
|
ProxySetting(ProxySetting proxy)
Copy Constructor for ProxySetting
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getPort()
Gets the port number upon which the proxy server communicates.
|
int |
getProtocol()
Gets the protocols defined by the PROTOCOL_* flags.
|
String |
getServer()
Returns the URL of the proxy server.
|
int |
hashCode() |
void |
setPort(int port)
Sets the port number the proxy server communicates on.
|
void |
setProtocol(int protocol)
Sets the protocols defined by the PROTOCOL_* flags.
|
void |
setServer(String server)
Sets the URL of the proxy server.
|
String |
toString()
Gets the proxy setting as a string.
|
public static final int PROTOCOL_FTP
public static final int PROTOCOL_HTTP
public static final int PROTOCOL_HTTPS
public static final int PROTOCOL_SOCKS
public static final int PROTOCOL_GOPHER
public static final int PROTOCOL_ALL
public ProxySetting()
public ProxySetting(int protocol, String server, int port)
protocol
- Protocol(s), defined by PROTOCOL_* flags.server
- URL of the proxy server.port
- Port the proxy server uses.PROTOCOL_ALL
,
PROTOCOL_FTP
,
PROTOCOL_GOPHER
,
PROTOCOL_HTTP
,
PROTOCOL_HTTPS
,
PROTOCOL_SOCKS
public ProxySetting(ProxySetting proxy)
proxy
- A ProxySetting to copypublic int getPort()
public int getProtocol()
PROTOCOL_ALL
,
PROTOCOL_FTP
,
PROTOCOL_GOPHER
,
PROTOCOL_HTTP
,
PROTOCOL_HTTPS
,
PROTOCOL_SOCKS
public String getServer()
public void setPort(int port)
port
- Port numberpublic void setProtocol(int protocol)
protocol
- Protocols.PROTOCOL_ALL
,
PROTOCOL_FTP
,
PROTOCOL_GOPHER
,
PROTOCOL_HTTP
,
PROTOCOL_HTTPS
,
PROTOCOL_SOCKS
public void setServer(String server)
server
- Proxy server URL.