Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 97b8c771 authored by alperozturk's avatar alperozturk
Browse files

fix code analytics

parent 0aa9c37b
Loading
Loading
Loading
Loading
+64 −61
Original line number Diff line number Diff line
@@ -21,14 +21,15 @@ import org.json.JSONObject
/**
 * Remote operation to store the folder metadata
 */
class StoreMetadataV2RemoteOperation @JvmOverloads constructor(
class StoreMetadataV2RemoteOperation
    @JvmOverloads
    constructor(
        private val remoteId: String,
        private val encryptedMetadataJson: String,
        private val token: String,
        private val signature: String,
        private val sessionTimeOut: SessionTimeOut = defaultSessionTimeOut
    ) : RemoteOperation<String>() {

        /**
         * @param client Client object
         */
@@ -44,7 +45,9 @@ class StoreMetadataV2RemoteOperation @JvmOverloads constructor(
                postMethod.addRequestHeader(E2E_TOKEN, token)
                postMethod.addRequestHeader(HEADER_SIGNATURE, signature)
                postMethod.setParameter(METADATA, encryptedMetadataJson)
            val status = client.executeMethod(postMethod, sessionTimeOut.readTimeOut, sessionTimeOut.connectionTimeOut)
                val status =
                    client
                        .executeMethod(postMethod, sessionTimeOut.readTimeOut, sessionTimeOut.connectionTimeOut)
                if (status == HttpStatus.SC_OK) {
                    val response = postMethod.responseBodyAsString

+37 −36
Original line number Diff line number Diff line
@@ -19,12 +19,13 @@ import org.apache.commons.httpclient.methods.DeleteMethod
/**
 * Unlock a file
 */
class UnlockFileV1RemoteOperation @JvmOverloads constructor(
class UnlockFileV1RemoteOperation
    @JvmOverloads
    constructor(
        private val localId: Long,
        private val token: String,
        private val sessionTimeOut: SessionTimeOut = defaultSessionTimeOut
    ) : RemoteOperation<Void>() {

        @Deprecated("Deprecated in Java")
        @Suppress("Detekt.TooGenericExceptionCaught")
        override fun run(client: OwnCloudClient): RemoteOperationResult<Void> {
+73 −70
Original line number Diff line number Diff line
@@ -23,7 +23,9 @@ import java.net.URLEncoder
/**
 * Remote operation to update the folder metadata
 */
class UpdateMetadataV2RemoteOperation @JvmOverloads constructor(
class UpdateMetadataV2RemoteOperation
    @JvmOverloads
    constructor(
        private val remoteId: String,
        encryptedMetadataJson: String,
        private val token: String,
@@ -57,11 +59,12 @@ class UpdateMetadataV2RemoteOperation @JvmOverloads constructor(
                        "UTF-8"
                    )
                putMethod.requestEntity = data
            val status = client.executeMethod(putMethod, sessionTimeOut.readTimeOut, sessionTimeOut.connectionTimeOut)
                val status =
                    client
                        .executeMethod(putMethod, sessionTimeOut.readTimeOut, sessionTimeOut.connectionTimeOut)
                if (status == HttpStatus.SC_OK) {
                    val response = putMethod.responseBodyAsString

                // Parse the response
                    val respJSON = JSONObject(response)
                    val metadata =
                        respJSON