diff --git a/data/src/main/java/com/github/nullptroma/wallenc/data/vaults/local/LocalStorageAccessor.kt b/data/src/main/java/com/github/nullptroma/wallenc/data/vaults/local/LocalStorageAccessor.kt index e1fb983..4a92bb8 100644 --- a/data/src/main/java/com/github/nullptroma/wallenc/data/vaults/local/LocalStorageAccessor.kt +++ b/data/src/main/java/com/github/nullptroma/wallenc/data/vaults/local/LocalStorageAccessor.kt @@ -7,6 +7,7 @@ import com.github.nullptroma.wallenc.domain.models.IStorageAccessor import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.StateFlow @@ -25,6 +26,8 @@ class LocalStorageAccessor( private val _size = MutableStateFlow(null) private val _numberOfFiles = MutableStateFlow(null) private val _isAvailable = MutableStateFlow(false) + private val _filesUpdates = MutableSharedFlow>() + private val _dirsUpdates = MutableSharedFlow>() override val size: StateFlow get() = _size @@ -33,9 +36,9 @@ class LocalStorageAccessor( override val isAvailable: StateFlow get() = _isAvailable override val filesUpdates: SharedFlow> - get() = TODO("Not yet implemented") + get() = _filesUpdates override val dirsUpdates: SharedFlow> - get() = TODO("Not yet implemented") + get() = _dirsUpdates init { CoroutineScope(ioDispatcher).launch { @@ -77,15 +80,15 @@ class LocalStorageAccessor( _numberOfFiles.value = numOfFiles } - override suspend fun getAllFiles(): List { + override suspend fun getAllFiles(): List = withContext(ioDispatcher) { if(checkAvailable() == false) - return listOf() + return@withContext listOf() val list = mutableListOf() - + return@withContext listOf() } - override suspend fun getFiles(path: String): List { + override suspend fun getFiles(path: String): List = withContext(ioDispatcher) { TODO("Not yet implemented") } @@ -93,11 +96,11 @@ class LocalStorageAccessor( TODO("Not yet implemented") } - override suspend fun getAllDirs(): List { + override suspend fun getAllDirs(): List = withContext(ioDispatcher) { TODO("Not yet implemented") } - override suspend fun getDirs(path: String): List { + override suspend fun getDirs(path: String): List = withContext(ioDispatcher) { TODO("Not yet implemented") } @@ -105,35 +108,35 @@ class LocalStorageAccessor( TODO("Not yet implemented") } - override suspend fun touchFile(path: String) { + override suspend fun touchFile(path: String) = withContext(ioDispatcher) { TODO("Not yet implemented") } - override suspend fun touchDir(path: String) { + override suspend fun touchDir(path: String) = withContext(ioDispatcher) { TODO("Not yet implemented") } - override suspend fun delete(path: String) { + override suspend fun delete(path: String) = withContext(ioDispatcher) { TODO("Not yet implemented") } - override suspend fun getFileInfo(path: String) { + override suspend fun getFileInfo(path: String) = withContext(ioDispatcher) { TODO("Not yet implemented") } - override suspend fun getDirInfo(path: String) { + override suspend fun getDirInfo(path: String) = withContext(ioDispatcher) { TODO("Not yet implemented") } - override suspend fun openWrite(path: String): InputStream { + override suspend fun openWrite(path: String): InputStream = withContext(ioDispatcher) { TODO("Not yet implemented") } - override suspend fun openRead(path: String): OutputStream { + override suspend fun openRead(path: String): OutputStream = withContext(ioDispatcher) { TODO("Not yet implemented") } - override suspend fun moveToTrash(path: String) { + override suspend fun moveToTrash(path: String) = withContext(ioDispatcher) { TODO("Not yet implemented") } } \ No newline at end of file diff --git a/data/src/main/java/com/github/nullptroma/wallenc/data/vaults/local/entity/LocalMetaInfo.kt b/data/src/main/java/com/github/nullptroma/wallenc/data/vaults/local/entity/LocalMetaInfo.kt index ead8162..7cc9e07 100644 --- a/data/src/main/java/com/github/nullptroma/wallenc/data/vaults/local/entity/LocalMetaInfo.kt +++ b/data/src/main/java/com/github/nullptroma/wallenc/data/vaults/local/entity/LocalMetaInfo.kt @@ -4,12 +4,7 @@ import com.github.nullptroma.wallenc.domain.models.IMetaInfo import java.time.LocalDateTime class LocalMetaInfo : IMetaInfo { - init { - - } - override val name: String - get() = TODO("Not yet implemented") override val size: Int get() = TODO("Not yet implemented") override val isDeleted: Boolean @@ -20,4 +15,8 @@ class LocalMetaInfo : IMetaInfo { get() = TODO("Not yet implemented") override val path: String get() = TODO("Not yet implemented") + + init { + name = "" + } } \ No newline at end of file diff --git a/wallenc-uml.gaphor b/wallenc-uml.gaphor index d76cc4b..11302ec 100644 --- a/wallenc-uml.gaphor +++ b/wallenc-uml.gaphor @@ -535,8 +535,6 @@ existing classes or even new classes with specific responsibilities. - - @@ -1303,17 +1301,6 @@ existing classes or even new classes with specific responsibilities. - - - - - -1 - - -+ totalSpace: StateFlow<Integer[0..1]> - - @@ -1341,17 +1328,6 @@ existing classes or even new classes with specific responsibilities. String - - - - - -1 - - -+ availableSpace: StateFlow<Integer[0..1]> - - @@ -3366,6 +3342,8 @@ existing classes or even new classes with specific responsibilities. + + @@ -3393,7 +3371,7 @@ existing classes or even new classes with specific responsibilities. 355.0 -134.0 +168.0 @@ -3425,7 +3403,7 @@ existing classes or even new classes with specific responsibilities. (1.0, 0.0, 0.0, 1.0, 29.099681659149553, 1343.3520695479824) -[(283.40031834085045, -3.35206954798241), (283.40031834085045, -168.3520695479824)] +[(283.40031834085045, -3.35206954798241), (283.40031834085045, -134.3520695479824)] @@ -3567,4 +3545,20 @@ existing classes or even new classes with specific responsibilities. 1 + + + + + ++ totalSpace: StateFlow<Integer[0..1]> + + + + + + + ++ availableSpace: StateFlow<Integer[0..1]> + + \ No newline at end of file