package com.syncflow.data.providers import com.syncflow.domain.model.CloudAccount import com.syncflow.domain.model.RemoteFile import kotlinx.coroutines.flow.Flow import java.io.InputStream import java.io.OutputStream interface CloudProvider { suspend fun testConnection(): Result suspend fun listFiles(remotePath: String): Result> suspend fun uploadFile( localStream: InputStream, remotePath: String, sizeBytes: Long, onProgress: (bytesWritten: Long) -> Unit = {}, ): Result suspend fun downloadFile( remotePath: String, destination: OutputStream, onProgress: (bytesRead: Long) -> Unit = {}, ): Result suspend fun deleteFile(remotePath: String): Result suspend fun createDirectory(remotePath: String): Result suspend fun getFileMetadata(remotePath: String): Result suspend fun moveFile(fromPath: String, toPath: String): Result companion object { const val CHUNK_SIZE = 8 * 1024 * 1024L // 8 MB } }