Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: tobiasKaminsky <[email protected]>
  • Loading branch information
tobiasKaminsky authored and AndyScherzinger committed Dec 29, 2022
1 parent 2deb17b commit 53401af
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
5 changes: 1 addition & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ dependencies {
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
androidTestImplementation "androidx.work:work-testing:${workVersion}"
implementation 'com.google.android:flexbox:2.0.1'
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}"
Expand Down Expand Up @@ -312,7 +309,7 @@ dependencies {

implementation 'com.github.nextcloud.android-common:ui:0.3.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
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
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;

Expand Down Expand Up @@ -75,10 +75,11 @@ public DavResponse readRemotePath() {
final Response[] rootElement = new Response[1];

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:
Expand All @@ -90,7 +91,6 @@ public Unit invoke(Response response, Response.HrefRelation hrefRelation) {
case OTHER:
default:
}
return Unit.INSTANCE;
}
});
} catch (IOException | DavException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class ChunkedFileUploader(
remoteFileBrowserItem.modifiedTimestamp = property.lastModified
}
is GetContentType -> {
remoteFileBrowserItem.mimeType = property.type
remoteFileBrowserItem.mimeType = property.type?.toString()
}
is OCSize -> {
remoteFileBrowserItem.size = property.ocSize
Expand Down

0 comments on commit 53401af

Please sign in to comment.