c2c-sync/app/src/androidTest/java/com/owncloud/android/EncryptionIT.kt
2025-09-18 17:54:51 +02:00

32 lines
822 B
Kotlin

/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Your Name <your@email.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.owncloud.android
import com.owncloud.android.datamodel.OCFile
import java.security.SecureRandom
open class EncryptionIT : AbstractIT() {
fun testFolder(): OCFile {
val rootPath = "/"
val folderPath = "/TestFolder/"
OCFile(rootPath).apply {
storageManager.saveFile(this)
}
return OCFile(folderPath).apply {
decryptedRemotePath = folderPath
isEncrypted = true
fileLength = SecureRandom().nextLong()
setFolder()
parentId = storageManager.getFileByDecryptedRemotePath(rootPath)!!.fileId
storageManager.saveFile(this)
}
}
}