File tree Expand file tree Collapse file tree
library/src/main/java/com/nextcloud/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
22 * Nextcloud Android Library
33 *
4- * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
4+ * SPDX-FileCopyrightText: 2019-2026 Nextcloud GmbH and Nextcloud contributors
5+ * SPDX-FileCopyrightText: 2026 Alper Ozturk <alper.ozturk@nextcloud.com>
56 * SPDX-FileCopyrightText: 2019-2024 Tobias Kaminsky
67 * SPDX-FileCopyrightText: 2023 Elv1zz <elv1zz.git@gmail.com>
78 * SPDX-FileCopyrightText: 2022 Álvaro Brey <alvaro@alvarobrey.com>
@@ -207,6 +208,18 @@ class NextcloudClient private constructor(
207208 }
208209 }
209210
211+ fun withSessionTimeOut (sessionTimeOut : SessionTimeOut ): NextcloudClient {
212+ val newClient =
213+ client
214+ .newBuilder()
215+ .readTimeout(sessionTimeOut.readTimeOut.toLong(), TimeUnit .MILLISECONDS )
216+ .connectTimeout(sessionTimeOut.connectionTimeOut.toLong(), TimeUnit .MILLISECONDS )
217+ // needed to prevent cancellation, seems like default value not applied
218+ .callTimeout(0 , TimeUnit .MILLISECONDS )
219+ .build()
220+ return NextcloudClient (delegate, credentials, newClient, context)
221+ }
222+
210223 fun getUserIdEncoded (): String = delegate.userIdEncoded!!
211224
212225 fun getUserIdPlain (): String = delegate.userId!!
You can’t perform that action at this time.
0 commit comments