Skip to content

Commit 530154f

Browse files
tobiasKaminskyAndyScherzinger
authored andcommitted
wip
Signed-off-by: tobiasKaminsky <[email protected]>
1 parent 1e4a5ec commit 530154f

File tree

17 files changed

+116
-534
lines changed

17 files changed

+116
-534
lines changed

app/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ dependencies {
311311
// implementation 'androidx.activity:activity-ktx:1.4.0'
312312

313313
implementation 'com.github.nextcloud.android-common:ui:0.3.0'
314+
315+
implementation("com.github.nextcloud:android-library:$androidLibraryVersion") {
316+
exclude group: 'org.ogce', module: 'xpp3' // unused in Android and brings wrong Junit version
317+
}
314318
}
315319

316320
task installGitHooks(type: Copy, group: "development") {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.nextcloud.talk.components.filebrowser.webdav
2+
3+
import android.net.Uri
4+
import androidx.test.platform.app.InstrumentationRegistry
5+
import com.nextcloud.talk.components.filebrowser.models.BrowserFile
6+
import com.nextcloud.talk.data.user.model.User
7+
import junit.framework.Assert.assertEquals
8+
import okhttp3.OkHttpClient
9+
import org.junit.Test
10+
11+
class ReadFilesystemOperationIT {
12+
@Test
13+
fun showContent() {
14+
val arguments = InstrumentationRegistry.getArguments()
15+
val url = Uri.parse(arguments.getString("TEST_SERVER_URL"))
16+
val username = arguments.getString("TEST_SERVER_USERNAME")
17+
val password = arguments.getString("TEST_SERVER_PASSWORD")
18+
19+
val client = OkHttpClient()
20+
val user = User().apply {
21+
baseUrl = url.toString()
22+
userId = username
23+
this.username = username
24+
token = password
25+
}
26+
val sut = ReadFilesystemOperation(client, user, "", 1)
27+
val data = sut.readRemotePath().data as List<BrowserFile>
28+
assertEquals(1, data.size)
29+
}
30+
}

app/src/main/java/com/nextcloud/talk/application/NextcloudTalkApplication.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ import coil.decode.SvgDecoder
5050
import coil.memory.MemoryCache
5151
import coil.util.DebugLogger
5252
import com.nextcloud.talk.BuildConfig
53-
import com.nextcloud.talk.components.filebrowser.webdav.DavUtils
5453
import com.nextcloud.talk.dagger.modules.BusModule
5554
import com.nextcloud.talk.dagger.modules.ContextModule
5655
import com.nextcloud.talk.dagger.modules.DatabaseModule
@@ -69,6 +68,7 @@ import com.nextcloud.talk.utils.database.arbitrarystorage.ArbitraryStorageModule
6968
import com.nextcloud.talk.utils.database.user.UserModule
7069
import com.nextcloud.talk.utils.preferences.AppPreferences
7170
import com.nextcloud.talk.webrtc.MagicWebRTCUtils
71+
import com.owncloud.android.lib.common.network.WebdavUtils
7272
import com.vanniktech.emoji.EmojiManager
7373
import com.vanniktech.emoji.google.GoogleEmojiProvider
7474
import de.cotech.hw.SecurityKeyManager
@@ -163,7 +163,7 @@ class NextcloudTalkApplication : MultiDexApplication(), LifecycleObserver {
163163

164164
initializeWebRtc()
165165
buildComponent()
166-
DavUtils.registerCustomFactories()
166+
WebdavUtils.registerCustomFactories()
167167

168168
componentApplication.inject(this)
169169

app/src/main/java/com/nextcloud/talk/components/filebrowser/models/BrowserFile.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ import at.bitfire.dav4jvm.property.GetLastModified
3030
import at.bitfire.dav4jvm.property.ResourceType
3131
import at.bitfire.dav4jvm.property.ResourceType.Companion.COLLECTION
3232
import com.bluelinelabs.logansquare.annotation.JsonObject
33-
import com.nextcloud.talk.components.filebrowser.models.properties.NCEncrypted
34-
import com.nextcloud.talk.components.filebrowser.models.properties.NCPermission
35-
import com.nextcloud.talk.components.filebrowser.models.properties.NCPreview
36-
import com.nextcloud.talk.components.filebrowser.models.properties.OCFavorite
3733
import com.nextcloud.talk.components.filebrowser.models.properties.OCId
3834
import com.nextcloud.talk.components.filebrowser.models.properties.OCSize
3935
import com.nextcloud.talk.utils.Mimetype.FOLDER
36+
import com.owncloud.android.lib.resources.files.webdav.NCEncrypted
37+
import com.owncloud.android.lib.resources.files.webdav.NCFavorite
38+
import com.owncloud.android.lib.resources.files.webdav.NCPermissions
39+
import com.owncloud.android.lib.resources.files.webdav.NCPreview
4040
import kotlinx.android.parcel.Parcelize
4141
import java.io.File
4242

@@ -101,7 +101,7 @@ data class BrowserFile(
101101
is NCPreview -> {
102102
browserFile.hasPreview = property.isNcPreview
103103
}
104-
is OCFavorite -> {
104+
is NCFavorite -> {
105105
browserFile.isFavorite = property.isOcFavorite
106106
}
107107
is DisplayName -> {
@@ -110,8 +110,8 @@ data class BrowserFile(
110110
is NCEncrypted -> {
111111
browserFile.isEncrypted = property.isNcEncrypted
112112
}
113-
is NCPermission -> {
114-
browserFile.permissions = property.ncPermission
113+
is NCPermissions -> {
114+
browserFile.permissions = property.permissions
115115
}
116116
}
117117
}

app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCEncrypted.kt

Lines changed: 0 additions & 61 deletions
This file was deleted.

app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPermission.kt

Lines changed: 0 additions & 63 deletions
This file was deleted.

app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/NCPreview.kt

Lines changed: 0 additions & 61 deletions
This file was deleted.

app/src/main/java/com/nextcloud/talk/components/filebrowser/models/properties/OCFavorite.kt

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)