- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 19 for cacheDir (0.04 sec)
-
okhttp/src/jvmTest/kotlin/okhttp3/internal/cache/DiskLruCacheTest.kt
cache = DiskLruCache(filesystem, cacheDir, appVersion, 2, maxSize.toLong(), taskRunner).also { toClose.add(it) } synchronized(cache) { cache.initialize() } } @BeforeEach fun setUp() { if (filesystem.exists(cacheDir)) { filesystem.deleteRecursively(cacheDir) } journalFile = cacheDir / DiskLruCache.JOURNAL_FILE journalBkpFile = cacheDir / DiskLruCache.JOURNAL_FILE_BACKUPRegistered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Sat Nov 01 12:18:11 UTC 2025 - 59.4K bytes - Viewed (0) -
regression-test/src/androidTest/java/okhttp/regression/compare/AndroidHttpEngineTest.kt
class AndroidHttpEngineTest { val context = InstrumentationRegistry.getInstrumentation().context val cacheDir = context.cacheDir.resolve("httpEngine").also { it.mkdirs() } val engine = HttpEngine .Builder(context) .setEnableBrotli(true) .setStoragePath(cacheDir.path) .setEnableHttpCache(HttpEngine.Builder.HTTP_CACHE_DISK, 10_000_000) .setConnectionMigrationOptions(Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Mar 19 19:25:20 UTC 2025 - 6.3K bytes - Viewed (0) -
okhttp-dnsoverhttps/README.md
### Download ```kotlin testImplementation("com.squareup.okhttp3:okhttp-dnsoverhttps:5.3.0") ``` ### Usage ``` val appCache = Cache(File("cacheDir", "okhttpcache"), 10 * 1024 * 1024) val bootstrapClient = OkHttpClient.Builder().cache(appCache).build() val dns = DnsOverHttps.Builder().client(bootstrapClient) .url("https://dns.google/dns-query".toHttpUrl())Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Thu Oct 30 21:39:59 UTC 2025 - 739 bytes - Viewed (0) -
okhttp/src/jvmTest/kotlin/okhttp3/EventListenerTest.kt
cache = makeCache() client = client.newBuilder().cache(cache).build() return cache } private fun makeCache(): Cache { val cacheDir = File.createTempFile("cache-", ".dir") cacheDir.delete() return Cache(cacheDir, (1024 * 1024).toLong()) } private fun OkHttpClient.newCallWithListener(request: Request): Call = newCall(request) .apply {
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Wed Nov 05 18:28:35 UTC 2025 - 70.5K bytes - Viewed (0) -
android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt
server.enqueue(MockResponse(body = "abc")) val ctxt = InstrumentationRegistry.getInstrumentation().targetContext.applicationContext val cacheSize = 1L * 1024 * 1024 // 1MB val cache = Cache(ctxt.cacheDir.resolve("testCache"), cacheSize) try { client = client .newBuilder() .cache(cache) .build() val request = Request
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Tue Nov 04 19:13:52 UTC 2025 - 29.9K bytes - Viewed (0) -
okhttp/src/commonJvmAndroid/kotlin/okhttp3/OkHttpClient.kt
* * ```java * // The singleton HTTP client. * public final OkHttpClient client = new OkHttpClient.Builder() * .addInterceptor(new HttpLoggingInterceptor()) * .cache(new Cache(cacheDir, cacheSize)) * .build(); * ``` * * ## Customize Your Client With newBuilder() * * You can customize a shared OkHttpClient instance with [newBuilder]. This builds a client that
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Tue Oct 07 21:55:03 UTC 2025 - 51.4K bytes - Viewed (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/EventListenerAdapter.kt
) = onEvent(SatisfactionFailure(System.nanoTime(), call)) override fun cacheMiss(call: Call) = onEvent(CacheMiss(System.nanoTime(), call)) override fun cacheHit( call: Call, response: Response, ) = onEvent(CacheHit(System.nanoTime(), call)) override fun cacheConditionalHit( call: Call, cachedResponse: Response, ) = onEvent(CacheConditionalHit(System.nanoTime(), call))
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Tue Nov 04 19:13:52 UTC 2025 - 7.1K bytes - Viewed (0) -
okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/LoggingEventListener.kt
override fun satisfactionFailure( call: Call, response: Response, ) { logWithTime("satisfactionFailure: $response") } override fun cacheHit( call: Call, response: Response, ) { logWithTime("cacheHit: $response") } override fun cacheMiss(call: Call) { logWithTime("cacheMiss") } override fun cacheConditionalHit( call: Call,
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Mon Oct 06 13:40:20 UTC 2025 - 5.8K bytes - Viewed (0) -
okhttp-logging-interceptor/src/test/java/okhttp3/logging/LoggingEventListenerTest.kt
listener.cacheConditionalHit(call, response) listener.cacheHit(call, response) listener.cacheMiss(call) listener.satisfactionFailure(call, response) logRecorder .assertLogMatch(Regex("""cacheConditionalHit: Response\{protocol=h2, code=200, message=, url=$url\}""")) .assertLogMatch(Regex("""cacheHit: Response\{protocol=h2, code=200, message=, url=$url\}"""))
Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Fri Jun 20 11:46:46 UTC 2025 - 10.2K bytes - Viewed (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/ClientRuleEventListener.kt
) { logWithTime("satisfactionFailure") } override fun cacheMiss(call: Call) { logWithTime("cacheMiss") } override fun cacheHit( call: Call, response: Response, ) { logWithTime("cacheHit") } override fun cacheConditionalHit( call: Call, cachedResponse: Response, ) { logWithTime("cacheConditionalHit") }Registered: Fri Dec 26 11:42:13 UTC 2025 - Last Modified: Tue Oct 07 21:03:04 UTC 2025 - 5.4K bytes - Viewed (0)