diff --git a/vector/src/main/java/im/vector/app/core/usecase/VectorBaseInOutUseCase.kt b/vector/src/main/java/im/vector/app/core/usecase/VectorBaseInOutUseCase.kt deleted file mode 100644 index 277da6794a..0000000000 --- a/vector/src/main/java/im/vector/app/core/usecase/VectorBaseInOutUseCase.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 New Vector Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package im.vector.app.core.usecase - -interface VectorBaseInOutUseCase { - suspend fun execute(input: T): Result -} diff --git a/vector/src/main/java/im/vector/app/features/media/domain/usecase/DownloadMediaUseCase.kt b/vector/src/main/java/im/vector/app/features/media/domain/usecase/DownloadMediaUseCase.kt index aca5661a8f..0f44b02143 100644 --- a/vector/src/main/java/im/vector/app/features/media/domain/usecase/DownloadMediaUseCase.kt +++ b/vector/src/main/java/im/vector/app/features/media/domain/usecase/DownloadMediaUseCase.kt @@ -20,7 +20,6 @@ import android.content.Context import androidx.core.net.toUri import dagger.hilt.android.qualifiers.ApplicationContext import im.vector.app.core.intent.getMimeTypeFromUri -import im.vector.app.core.usecase.VectorBaseInOutUseCase import im.vector.app.core.utils.saveMedia import im.vector.app.features.notifications.NotificationUtils import kotlinx.coroutines.withContext @@ -32,14 +31,10 @@ class DownloadMediaUseCase @Inject constructor( @ApplicationContext private val appContext: Context, private val coroutineDispatchers: MatrixCoroutineDispatchers, private val notificationUtils: NotificationUtils -) : VectorBaseInOutUseCase { +) { - // TODO - // what about UseCase Interface enforcing single type input? => no interface - // add unit tests - // PR to template structure of a class for discussion - - override suspend fun execute(input: File): Result = withContext(coroutineDispatchers.io) { + // TODO add unit tests: https://github.com/vector-im/element-android/tree/develop/vector/src/test/java/im/vector/app/test + suspend fun execute(input: File): Result = withContext(coroutineDispatchers.io) { runCatching { saveMedia( context = appContext,