Package ej.rest.web
Class Resty.Option
- java.lang.Object
-
- ej.rest.web.Resty.Option
-
- Direct Known Subclasses:
Resty.Timeout
- Enclosing class:
- Resty
public abstract static class Resty.Option extends Object
Base class for Resty options. You can also create your own options. Override one of the apply methods to change an object like URLConnection before it is being used.
-
-
Constructor Summary
Constructors Constructor Description Option()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(URLConnection aConnection)Override this to get access to the URLConnection before the actual connection is made.voidinit(Resty resty)Callback from Resty when the option is set on the Resty instance.static Resty.Timeouttimeout(int t)Specify the connection timeout in milliseconds.
-
-
-
Method Detail
-
apply
public void apply(URLConnection aConnection)
Override this to get access to the URLConnection before the actual connection is made.- Parameters:
aConnection-
-
init
public void init(Resty resty)
Callback from Resty when the option is set on the Resty instance. Called before any connection is made. Override to set initial properties
-
timeout
public static Resty.Timeout timeout(int t)
Specify the connection timeout in milliseconds. Example:new Resty(Option.timeout(3000));- Parameters:
t- the timeout- Returns:
- See Also:
URLConnection.setConnectTimeout(int)
-
-