File tree 7 files changed +693
-61
lines changed
client/src/main/java/org/asynchttpclient
7 files changed +693
-61
lines changed Original file line number Diff line number Diff line change 24
24
import org .asynchttpclient .channel .ChannelPool ;
25
25
import org .asynchttpclient .channel .DefaultKeepAliveStrategy ;
26
26
import org .asynchttpclient .channel .KeepAliveStrategy ;
27
+ import org .asynchttpclient .config .AsyncHttpClientConfigDefaults ;
27
28
import org .asynchttpclient .cookie .CookieStore ;
28
29
import org .asynchttpclient .cookie .ThreadSafeCookieStore ;
29
30
import org .asynchttpclient .filter .IOExceptionFilter ;
49
50
*/
50
51
public class DefaultAsyncHttpClientConfig implements AsyncHttpClientConfig {
51
52
52
- private static final String AHC_VERSION ;
53
-
54
- static {
55
- try (InputStream is = DefaultAsyncHttpClientConfig .class .getResourceAsStream ("/ahc-version.properties" )) {
56
- Properties prop = new Properties ();
57
- prop .load (is );
58
- AHC_VERSION = prop .getProperty ("ahc.version" , "UNKNOWN" );
59
- } catch (IOException e ) {
60
- throw new ExceptionInInitializerError (e );
61
- }
62
- }
63
-
64
53
// http
65
54
private final boolean followRedirect ;
66
55
private final int maxRedirects ;
@@ -302,7 +291,7 @@ private DefaultAsyncHttpClientConfig(// http
302
291
303
292
@ Override
304
293
public String getAhcVersion () {
305
- return AHC_VERSION ;
294
+ return AsyncHttpClientConfigDefaults . AHC_VERSION ;
306
295
}
307
296
308
297
// http
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 20
20
<module >rxjava2</module >
21
21
<module >simple</module >
22
22
<module >retrofit2</module >
23
+ <module >typesafeconfig</module >
23
24
</modules >
24
25
25
26
<dependencies >
Original file line number Diff line number Diff line change
1
+ # Async-http-client and Typesafe Config integration
2
+
3
+ An ` AsyncHttpClientConfig ` implementation integrating [ Typesafe Config] [ 1 ] with Async Http Client.
4
+ ## Download
5
+
6
+ Download [ the latest JAR] [ 2 ] or grab via [ Maven] [ 3 ] :
7
+
8
+ ``` xml
9
+ <dependency >
10
+ <groupId >org.asynchttpclient</groupId >
11
+ <artifactId >async-http-client-extras-typesafeconfig</artifactId >
12
+ <version >latest.version</version >
13
+ </dependency >
14
+ ```
15
+
16
+ or [ Gradle] [ 3 ] :
17
+
18
+ ``` groovy
19
+ compile "org.asynchttpclient:async-http-client-extras-typesafeconfig:latest.version"
20
+ ```
21
+
22
+ [ 1 ] : https://github.com/lightbend/config
23
+ [ 2 ] : https://search.maven.org/remote_content?g=org.asynchttpclient&a=async-http-client-extras-typesafeconfig&v=LATEST
24
+ [ 3 ] : http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.asynchttpclient%22%20a%3A%22async-http-client-extras-typesafeconfig%22
25
+ [ snap ] : https://oss.sonatype.org/content/repositories/snapshots/
26
+
27
+ ## Example usage
28
+
29
+ ``` java
30
+ // creating async-http-client with Typesafe config
31
+ com.typesafe.config. Config config = ...
32
+ AsyncHttpClientTypesafeConfig ahcConfig = new AsyncHttpClientTypesafeConfig (config);
33
+ AsyncHttpClient client = new DefaultAsyncHttpClient (ahcConfig);
34
+ ```
Original file line number Diff line number Diff line change
1
+ <project xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xmlns =" http://maven.apache.org/POM/4.0.0"
2
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+
5
+ <parent >
6
+ <artifactId >async-http-client-extras-parent</artifactId >
7
+ <groupId >org.asynchttpclient</groupId >
8
+ <version >2.2.0-SNAPSHOT</version >
9
+ </parent >
10
+
11
+ <artifactId >async-http-client-extras-typesafe-config</artifactId >
12
+ <name >Asynchronous Http Client Typesafe Config Extras</name >
13
+ <description >The Async Http Client Typesafe Config Extras.</description >
14
+
15
+ <properties >
16
+ <typesafeconfig .version>1.3.2</typesafeconfig .version>
17
+ </properties >
18
+
19
+ <dependencies >
20
+ <dependency >
21
+ <groupId >com.typesafe</groupId >
22
+ <artifactId >config</artifactId >
23
+ <version >${typesafeconfig.version} </version >
24
+ </dependency >
25
+ </dependencies >
26
+ </project >
You can’t perform that action at this time.
0 commit comments