Merge pull request #1204 from nextcloud/dependabot/gradle/com.gitlab.bitfireAT-dav4jvm-2.1.2

Bump dav4jvm from f2078bc846 to 2.1.2
This commit is contained in:
Andy Scherzinger 2021-05-08 13:00:37 +02:00 committed by GitHub
commit 742218d499
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 58 additions and 45 deletions

View File

@ -156,7 +156,7 @@ ext {
butterknifeVersion = "10.2.3"
coilKtVersion = "1.2.1"
daggerVersion = "2.35.1"
okhttpVersion = "3.14.2"
okhttpVersion = "4.9.1"
materialDialogsVersion = "3.3.0"
parcelerVersion = "1.1.13"
powermockVersion = "2.0.9"
@ -184,7 +184,7 @@ 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:f2078bc846', {
implementation ('com.gitlab.bitfireAT:dav4jvm:2.1.2', {
exclude group: 'org.ogce', module: 'xpp3' // Android comes with its own XmlPullParser
})
ktlint "com.pinterest:ktlint:0.41.0"

View File

@ -36,12 +36,12 @@ import org.parceler.Parcel;
import java.io.File;
import java.util.List;
import at.bitfire.dav4android.Property;
import at.bitfire.dav4android.Response;
import at.bitfire.dav4android.property.DisplayName;
import at.bitfire.dav4android.property.GetContentType;
import at.bitfire.dav4android.property.GetLastModified;
import at.bitfire.dav4android.property.ResourceType;
import at.bitfire.dav4jvm.Property;
import at.bitfire.dav4jvm.Response;
import at.bitfire.dav4jvm.property.DisplayName;
import at.bitfire.dav4jvm.property.GetContentType;
import at.bitfire.dav4jvm.property.GetLastModified;
import at.bitfire.dav4jvm.property.ResourceType;
@JsonObject
@Parcel

View File

@ -20,7 +20,7 @@
package com.nextcloud.talk.components.filebrowser.models;
import at.bitfire.dav4android.Response;
import at.bitfire.dav4jvm.Response;
public class DavResponse {
public Response response;

View File

@ -32,9 +32,9 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import at.bitfire.dav4android.Property;
import at.bitfire.dav4android.PropertyFactory;
import at.bitfire.dav4android.XmlUtils;
import at.bitfire.dav4jvm.Property;
import at.bitfire.dav4jvm.PropertyFactory;
import at.bitfire.dav4jvm.XmlUtils;
public class NCEncrypted implements Property {
public static final Name NAME = new Name(DavUtils.NC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_IS_ENCRYPTED);

View File

@ -34,9 +34,9 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import at.bitfire.dav4android.Property;
import at.bitfire.dav4android.PropertyFactory;
import at.bitfire.dav4android.XmlUtils;
import at.bitfire.dav4jvm.Property;
import at.bitfire.dav4jvm.PropertyFactory;
import at.bitfire.dav4jvm.XmlUtils;
public class NCPermission implements Property {
public static final Name NAME = new Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_PERMISSIONS);

View File

@ -32,9 +32,9 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import at.bitfire.dav4android.Property;
import at.bitfire.dav4android.PropertyFactory;
import at.bitfire.dav4android.XmlUtils;
import at.bitfire.dav4jvm.Property;
import at.bitfire.dav4jvm.PropertyFactory;
import at.bitfire.dav4jvm.XmlUtils;
public class NCPreview implements Property {
public static final Property.Name NAME = new Property.Name(DavUtils.NC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_HAS_PREVIEW);

View File

@ -32,9 +32,9 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import at.bitfire.dav4android.Property;
import at.bitfire.dav4android.PropertyFactory;
import at.bitfire.dav4android.XmlUtils;
import at.bitfire.dav4jvm.Property;
import at.bitfire.dav4jvm.PropertyFactory;
import at.bitfire.dav4jvm.XmlUtils;
public class OCFavorite implements Property {
public static final Property.Name NAME = new Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_FAVORITE);

View File

@ -32,9 +32,9 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import at.bitfire.dav4android.Property;
import at.bitfire.dav4android.PropertyFactory;
import at.bitfire.dav4android.XmlUtils;
import at.bitfire.dav4jvm.Property;
import at.bitfire.dav4jvm.PropertyFactory;
import at.bitfire.dav4jvm.XmlUtils;
public class OCId implements Property {
public static final Name NAME = new Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_REMOTE_ID);

View File

@ -32,9 +32,9 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import at.bitfire.dav4android.Property;
import at.bitfire.dav4android.PropertyFactory;
import at.bitfire.dav4android.XmlUtils;
import at.bitfire.dav4jvm.Property;
import at.bitfire.dav4jvm.PropertyFactory;
import at.bitfire.dav4jvm.XmlUtils;
public class OCSize implements Property {
public static final Property.Name NAME = new Property.Name(DavUtils.OC_NAMESPACE, DavUtils.EXTENDED_PROPERTY_NAME_SIZE);

View File

@ -20,11 +20,12 @@
package com.nextcloud.talk.components.filebrowser.webdav;
import at.bitfire.dav4android.Property;
import at.bitfire.dav4android.PropertyFactory;
import at.bitfire.dav4android.PropertyRegistry;
import at.bitfire.dav4android.property.*;
import com.nextcloud.talk.components.filebrowser.models.properties.*;
import com.nextcloud.talk.components.filebrowser.models.properties.NCEncrypted;
import com.nextcloud.talk.components.filebrowser.models.properties.NCPermission;
import com.nextcloud.talk.components.filebrowser.models.properties.NCPreview;
import com.nextcloud.talk.components.filebrowser.models.properties.OCFavorite;
import com.nextcloud.talk.components.filebrowser.models.properties.OCId;
import com.nextcloud.talk.components.filebrowser.models.properties.OCSize;
import java.lang.reflect.Field;
import java.util.ArrayList;
@ -32,6 +33,17 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import at.bitfire.dav4jvm.Property;
import at.bitfire.dav4jvm.PropertyFactory;
import at.bitfire.dav4jvm.PropertyRegistry;
import at.bitfire.dav4jvm.property.CreationDate;
import at.bitfire.dav4jvm.property.DisplayName;
import at.bitfire.dav4jvm.property.GetContentLength;
import at.bitfire.dav4jvm.property.GetContentType;
import at.bitfire.dav4jvm.property.GetETag;
import at.bitfire.dav4jvm.property.GetLastModified;
import at.bitfire.dav4jvm.property.ResourceType;
public class DavUtils {
public static final String OC_NAMESPACE = "http://owncloud.org/ns";
public static final String NC_NAMESPACE = "http://nextcloud.org/ns";

View File

@ -20,23 +20,24 @@
package com.nextcloud.talk.components.filebrowser.webdav;
import at.bitfire.dav4android.DavResource;
import at.bitfire.dav4android.Response;
import at.bitfire.dav4android.exception.DavException;
import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
import com.nextcloud.talk.components.filebrowser.models.DavResponse;
import com.nextcloud.talk.dagger.modules.RestModule;
import com.nextcloud.talk.models.database.UserEntity;
import com.nextcloud.talk.utils.ApiUtils;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import at.bitfire.dav4jvm.DavResource;
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;
public class ReadFilesystemOperation {
private final OkHttpClient okHttpClient;
private final String url;

View File

@ -1267,7 +1267,7 @@ class ChatController(args: Bundle) :
val xChatLastCommonRead = response.headers().get("X-Chat-Last-Common-Read")?.let {
Integer.parseInt(it)
}
if (response.headers().size() > 0 && !TextUtils.isEmpty(xChatLastGivenHeader)) {
if (response.headers().size > 0 && !TextUtils.isEmpty(xChatLastGivenHeader)) {
val header = Integer.parseInt(xChatLastGivenHeader!!)
if (header > 0) {

View File

@ -54,8 +54,8 @@ import io.reactivex.Observer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import okhttp3.MediaType
import okhttp3.RequestBody
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody.Companion.toRequestBody
import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class)
@ -122,7 +122,7 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
ncApi.searchContactsByPhoneNumber(
ApiUtils.getCredentials(currentUser.username, currentUser.token),
ApiUtils.getUrlForSearchByNumber(currentUser.baseUrl),
RequestBody.create(MediaType.parse("application/json"), json)
json.toRequestBody("application/json".toMediaTypeOrNull())
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())

View File

@ -44,7 +44,7 @@ import io.reactivex.Observer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody
import retrofit2.Response
import java.io.File
@ -103,7 +103,7 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
val input: InputStream = context.contentResolver.openInputStream(sourcefileUri)!!
val buf = ByteArray(input.available())
while (input.read(buf) != -1);
requestBody = RequestBody.create(MediaType.parse("application/octet-stream"), buf)
requestBody = RequestBody.create("application/octet-stream".toMediaTypeOrNull(), buf)
} catch (e: Exception) {
Log.e(javaClass.simpleName, "failed to create RequestBody for $sourcefileUri", e)
}