mirror of
https://github.com/square/okhttp.git
synced 2025-11-26 06:43:09 +03:00
Refactor towards an OkHttpClient.Builder.
Still some work to do on method naming, but this was the interesting part. Also very much need to rename OkUrlFactory in tests to urlFactory, otherwise the client.client stuff becomes madness.
This commit is contained in:
@@ -120,9 +120,10 @@ public final class Crawler {
|
||||
int threadCount = 20;
|
||||
long cacheByteCount = 1024L * 1024L * 100L;
|
||||
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
Cache cache = new Cache(new File(args[0]), cacheByteCount);
|
||||
client.setCache(cache);
|
||||
OkHttpClient client = new OkHttpClient.Builder()
|
||||
.setCache(cache)
|
||||
.build();
|
||||
|
||||
Crawler crawler = new Crawler(client);
|
||||
crawler.queue.add(HttpUrl.parse(args[1]));
|
||||
|
||||
Reference in New Issue
Block a user