mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Rename ReadFilesystemOperation
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
3330df3b66
commit
7f85a2f228
@ -45,7 +45,7 @@ import com.nextcloud.talk.R;
|
|||||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
|
import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
|
||||||
import com.nextcloud.talk.components.filebrowser.models.DavResponse;
|
import com.nextcloud.talk.components.filebrowser.models.DavResponse;
|
||||||
import com.nextcloud.talk.components.filebrowser.webdav.LegacyReadFilesystemOperation;
|
import com.nextcloud.talk.components.filebrowser.webdav.ReadFilesystemOperation;
|
||||||
import com.nextcloud.talk.databinding.ReactionsInsideMessageBinding;
|
import com.nextcloud.talk.databinding.ReactionsInsideMessageBinding;
|
||||||
import com.nextcloud.talk.models.database.UserEntity;
|
import com.nextcloud.talk.models.database.UserEntity;
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
import com.nextcloud.talk.models.json.chat.ChatMessage;
|
||||||
@ -289,20 +289,20 @@ public abstract class MagicPreviewMessageViewHolder extends MessageHolders.Incom
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void fetchFileInformation(String url, UserEntity activeUser) {
|
private void fetchFileInformation(String url, UserEntity activeUser) {
|
||||||
Single.fromCallable(new Callable<LegacyReadFilesystemOperation>() {
|
Single.fromCallable(new Callable<ReadFilesystemOperation>() {
|
||||||
@Override
|
@Override
|
||||||
public LegacyReadFilesystemOperation call() {
|
public ReadFilesystemOperation call() {
|
||||||
return new LegacyReadFilesystemOperation(okHttpClient, activeUser, url, 0);
|
return new ReadFilesystemOperation(okHttpClient, activeUser, url, 0);
|
||||||
}
|
}
|
||||||
}).observeOn(Schedulers.io())
|
}).observeOn(Schedulers.io())
|
||||||
.subscribe(new SingleObserver<LegacyReadFilesystemOperation>() {
|
.subscribe(new SingleObserver<ReadFilesystemOperation>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
// unused atm
|
// unused atm
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(@NonNull LegacyReadFilesystemOperation readFilesystemOperation) {
|
public void onSuccess(@NonNull ReadFilesystemOperation readFilesystemOperation) {
|
||||||
DavResponse davResponse = readFilesystemOperation.readRemotePath();
|
DavResponse davResponse = readFilesystemOperation.readRemotePath();
|
||||||
if (davResponse.data != null) {
|
if (davResponse.data != null) {
|
||||||
List<BrowserFile> browserFileList = (List<BrowserFile>) davResponse.data;
|
List<BrowserFile> browserFileList = (List<BrowserFile>) davResponse.data;
|
||||||
|
@ -26,7 +26,7 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.nextcloud.talk.components.filebrowser.interfaces.ListingInterface;
|
import com.nextcloud.talk.components.filebrowser.interfaces.ListingInterface;
|
||||||
import com.nextcloud.talk.components.filebrowser.models.DavResponse;
|
import com.nextcloud.talk.components.filebrowser.models.DavResponse;
|
||||||
import com.nextcloud.talk.components.filebrowser.webdav.LegacyReadFilesystemOperation;
|
import com.nextcloud.talk.components.filebrowser.webdav.ReadFilesystemOperation;
|
||||||
import com.nextcloud.talk.models.database.UserEntity;
|
import com.nextcloud.talk.models.database.UserEntity;
|
||||||
|
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
@ -50,20 +50,20 @@ public class DavListing extends ListingAbstractClass {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getFiles(String path, UserEntity currentUser, @Nullable OkHttpClient okHttpClient) {
|
public void getFiles(String path, UserEntity currentUser, @Nullable OkHttpClient okHttpClient) {
|
||||||
Single.fromCallable(new Callable<LegacyReadFilesystemOperation>() {
|
Single.fromCallable(new Callable<ReadFilesystemOperation>() {
|
||||||
@Override
|
@Override
|
||||||
public LegacyReadFilesystemOperation call() {
|
public ReadFilesystemOperation call() {
|
||||||
return new LegacyReadFilesystemOperation(okHttpClient, currentUser, path, 1);
|
return new ReadFilesystemOperation(okHttpClient, currentUser, path, 1);
|
||||||
}
|
}
|
||||||
}).subscribeOn(Schedulers.io())
|
}).subscribeOn(Schedulers.io())
|
||||||
.subscribe(new SingleObserver<LegacyReadFilesystemOperation>() {
|
.subscribe(new SingleObserver<ReadFilesystemOperation>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(@NonNull LegacyReadFilesystemOperation readFilesystemOperation) {
|
public void onSuccess(@NonNull ReadFilesystemOperation readFilesystemOperation) {
|
||||||
davResponse = readFilesystemOperation.readRemotePath();
|
davResponse = readFilesystemOperation.readRemotePath();
|
||||||
try {
|
try {
|
||||||
listingInterface.listingResult(davResponse);
|
listingInterface.listingResult(davResponse);
|
||||||
|
@ -40,15 +40,14 @@ import kotlin.jvm.functions.Function2;
|
|||||||
import okhttp3.HttpUrl;
|
import okhttp3.HttpUrl;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
|
|
||||||
@Deprecated
|
public class ReadFilesystemOperation {
|
||||||
public class LegacyReadFilesystemOperation {
|
|
||||||
private static final String TAG = "ReadFilesystemOperation";
|
private static final String TAG = "ReadFilesystemOperation";
|
||||||
private final OkHttpClient okHttpClient;
|
private final OkHttpClient okHttpClient;
|
||||||
private final String url;
|
private final String url;
|
||||||
private final int depth;
|
private final int depth;
|
||||||
private final String basePath;
|
private final String basePath;
|
||||||
|
|
||||||
public LegacyReadFilesystemOperation(OkHttpClient okHttpClient, UserEntity currentUser, String path, int depth) {
|
public ReadFilesystemOperation(OkHttpClient okHttpClient, UserEntity currentUser, String path, int depth) {
|
||||||
OkHttpClient.Builder okHttpClientBuilder = okHttpClient.newBuilder();
|
OkHttpClient.Builder okHttpClientBuilder = okHttpClient.newBuilder();
|
||||||
okHttpClientBuilder.followRedirects(false);
|
okHttpClientBuilder.followRedirects(false);
|
||||||
okHttpClientBuilder.followSslRedirects(false);
|
okHttpClientBuilder.followSslRedirects(false);
|
||||||
@ -92,7 +91,7 @@ public class LegacyReadFilesystemOperation {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (IOException | DavException e) {
|
} catch (IOException | DavException e) {
|
||||||
Log.w("", "Error reading remote path");
|
Log.w(TAG, "Error reading remote path");
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteFiles.add(BrowserFile.Companion.getModelFromResponse(rootElement[0],
|
remoteFiles.add(BrowserFile.Companion.getModelFromResponse(rootElement[0],
|
Loading…
Reference in New Issue
Block a user