Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2022-11-03 11:55:29 +01:00 committed by Andy Scherzinger
parent 2dc413a553
commit 2d56506cbb
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
6 changed files with 11 additions and 14 deletions

View file

@ -184,9 +184,6 @@ dependencies {
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
androidTestImplementation "androidx.work:work-testing:${workVersion}"
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation ('com.gitlab.bitfireAT:dav4jvm:2.1.3', {
exclude group: 'org.ogce', module: 'xpp3' // Android comes with its own XmlPullParser
})
implementation 'org.conscrypt:conscrypt-android:2.5.2'
implementation "androidx.camera:camera-core:${androidxCameraVersion}"
@ -312,7 +309,7 @@ dependencies {
implementation 'com.github.nextcloud-deps:android-talk-webrtc:110.5481.0'
implementation("com.github.nextcloud:android-library:$androidLibraryVersion") {
api("com.github.nextcloud:android-library:$androidLibraryVersion") {
exclude group: 'org.ogce', module: 'xpp3' // unused in Android and brings wrong Junit version
}
}

View file

@ -23,7 +23,7 @@ class ReadFilesystemOperationIT {
this.username = username
token = password
}
val sut = ReadFilesystemOperation(client, user, "", 1)
val sut = ReadFilesystemOperation(client, user, "/", 1)
val data = sut.readRemotePath().data as List<BrowserFile>
assertEquals(1, data.size)
}

View file

@ -94,7 +94,7 @@ data class BrowserFile(
browserFile.modifiedTimestamp = property.lastModified
}
is GetContentType -> {
browserFile.mimeType = property.type
browserFile.mimeType = property.type?.toString()
}
is OCSize -> {
browserFile.size = property.ocSize

View file

@ -36,11 +36,11 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import at.bitfire.dav4jvm.DavResource;
import at.bitfire.dav4jvm.MultiResponseCallback;
import at.bitfire.dav4jvm.Response;
import at.bitfire.dav4jvm.exception.DavException;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
@ -77,10 +77,11 @@ public class ReadFilesystemOperation {
final List<RemoteFile> remoteFiles = new ArrayList<>();
try {
new DavResource(okHttpClient, HttpUrl.parse(url)).propfind(depth, WebdavUtils.getAllPropertiesList(),
new Function2<Response, Response.HrefRelation, Unit>() {
new DavResource(okHttpClient, HttpUrl.parse(url)).propfind(depth,
WebdavUtils.getAllPropertiesList(),
new MultiResponseCallback() {
@Override
public Unit invoke(Response response, Response.HrefRelation hrefRelation) {
public void onResponse(@NonNull Response response, @NonNull Response.HrefRelation hrefRelation) {
davResponse.setResponse(response);
switch (hrefRelation) {
case MEMBER:
@ -92,7 +93,6 @@ public class ReadFilesystemOperation {
case OTHER:
default:
}
return Unit.INSTANCE;
}
});
} catch (IOException | DavException e) {

View file

@ -151,7 +151,7 @@ class ReadFolderListingOperation(okHttpClient: OkHttpClient, currentUser: User,
remoteFileBrowserItem.modifiedTimestamp = property.lastModified
}
is GetContentType -> {
remoteFileBrowserItem.mimeType = property.type
remoteFileBrowserItem.mimeType = property.type?.toString()
}
is OCSize -> {
remoteFileBrowserItem.size = property.ocSize

View file

@ -368,7 +368,7 @@ class ChunkedFileUploader(
remoteFileBrowserItem.modifiedTimestamp = property.lastModified
}
is GetContentType -> {
remoteFileBrowserItem.mimeType = property.type
remoteFileBrowserItem.mimeType = property.type?.toString()
}
is OCSize -> {
remoteFileBrowserItem.size = property.ocSize