Skip to content

Commit

Permalink
ktlintFormat
Browse files Browse the repository at this point in the history
Signed-off-by: sowjanyakch <[email protected]>
  • Loading branch information
sowjanyakch committed Feb 28, 2025
1 parent be20318 commit 66439d5
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions app/src/main/java/com/nextcloud/talk/upload/normal/FileUploader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
}
}

0 comments on commit 66439d5

Please sign in to comment.