ktlintFormat

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2025-02-26 19:48:59 +01:00 committed by Marcel Hibbe
parent c0376c8eed
commit 2ef4ff6e40
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -41,8 +41,7 @@ class FileUploader(
) {
private var okHttpClientNoRedirects: OkHttpClient? = null
private var okhttpClient:OkHttpClient = okHttpClient
private var okhttpClient: OkHttpClient = okHttpClient
init {
initHttpClient(okHttpClient, currentUser)
@ -71,11 +70,18 @@ class FileUploader(
}
}
private fun createDavResource(sourceFileUri: Uri, fileName: String, remotePath: String, metaData: String?): Observable<Boolean> {
private fun createDavResource(
sourceFileUri: Uri,
fileName: String,
remotePath: String,
metaData: String?
): Observable<Boolean> {
return Observable.fromCallable {
val userFileUploadPath = ApiUtils.userFileUploadPath(currentUser.baseUrl!!, currentUser.userId!!)
val userTalkAttachmentsUploadPath = ApiUtils.userTalkAttachmentsUploadPath(currentUser.baseUrl!!, currentUser.userId!!)
val userTalkAttachmentsUploadPath = ApiUtils.userTalkAttachmentsUploadPath(
currentUser.baseUrl!!,
currentUser.userId!!
)
var davResource = DavResource(okHttpClientNoRedirects!!, userFileUploadPath.toHttpUrlOrNull()!!)
createFolder(davResource)
@ -88,7 +94,6 @@ class FileUploader(
.flatMap { upload(sourceFileUri, fileName, remotePath, metaData) }
}
@Suppress("Detekt.TooGenericExceptionCaught")
private fun createRequestBody(sourceFileUri: Uri): RequestBody? {
var requestBody: RequestBody? = null
@ -144,11 +149,10 @@ class FileUploader(
}
}
companion object {
private val TAG = FileUploader::class.simpleName
private const val METHOD_NOT_ALLOWED_CODE: Int = 405
private const val HTTP_CODE_NOT_FOUND:Int = 404
private const val HTTP_CODE_CONFLICT : Int = 409
private const val HTTP_CODE_NOT_FOUND: Int = 404
private const val HTTP_CODE_CONFLICT: Int = 409
}
}