Package de.sfuhrm.radiorecorder.http
Schnittstelle HttpConnectionBuilder
public interface HttpConnectionBuilder
Configures an HttpConnection. The connection can be created
after construction.
- Autor:
- Stephan Fuhrmann
- Siehe auch:
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbuild()Constructs a connection from this builder.voidsetConnectTimeout(int timeout) Configures the timeout for connecting to the server.voidSets the HTTP/HTTPS proxy to use.voidsetReadTimeout(int timeout) Configures the timeout for reading from the server.voidsetRequestProperty(String key, String value) Adds an HTTP request header field to the request.
-
Methodendetails
-
setConnectTimeout
void setConnectTimeout(int timeout) Configures the timeout for connecting to the server.- Parameter:
timeout- the timeout in milliseconds.
-
setReadTimeout
void setReadTimeout(int timeout) Configures the timeout for reading from the server.- Parameter:
timeout- the timeout in milliseconds.
-
setRequestProperty
Adds an HTTP request header field to the request.- Parameter:
key- the header field name, for example "User-Agent".value- the header field value.
-
setProxy
Sets the HTTP/HTTPS proxy to use.- Parameter:
proxy- the URL of the proxy to use.
-
build
Constructs a connection from this builder. The connection is usually being opened by this method.- Gibt zurück:
- an open HTTP connection.
- Löst aus:
IOException- if building the connection with the given parameters failed.
-