-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Storage sdk: Implement update functionality in non gms.
- Loading branch information
1 parent
56512e0
commit a20c178
Showing
9 changed files
with
107 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
storage-api/src/main/java/com/omh/android/storage/api/domain/usecase/UpdateFileUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.omh.android.storage.api.domain.usecase | ||
|
||
import com.omh.android.storage.api.domain.model.OmhFile | ||
import com.omh.android.storage.api.domain.repository.OmhFileRepository | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
import java.io.File | ||
|
||
class UpdateFileUseCase( | ||
private val repository: OmhFileRepository, | ||
dispatcher: CoroutineDispatcher = Dispatchers.Default | ||
) : OmhSuspendUseCase<UpdateFileUseCaseParams, UpdateFileUseCaseResult>(dispatcher) { | ||
|
||
override suspend fun execute(parameters: UpdateFileUseCaseParams): UpdateFileUseCaseResult { | ||
return UpdateFileUseCaseResult( | ||
repository.updateFile(parameters.localFileToUpdate, parameters.fileId, parameters.parentId) | ||
) | ||
} | ||
} | ||
|
||
data class UpdateFileUseCaseParams(val localFileToUpdate: File, val fileId: String, val parentId: String?) | ||
|
||
data class UpdateFileUseCaseResult(val file: OmhFile?) |