Rename ReadFilesystemOperation

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-06-07 20:47:56 +02:00
parent 3330df3b66
commit 7f85a2f228
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
3 changed files with 15 additions and 16 deletions

View File

@ -45,7 +45,7 @@ import com.nextcloud.talk.R;
import com.nextcloud.talk.application.NextcloudTalkApplication;
import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
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.models.database.UserEntity;
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) {
Single.fromCallable(new Callable<LegacyReadFilesystemOperation>() {
Single.fromCallable(new Callable<ReadFilesystemOperation>() {
@Override
public LegacyReadFilesystemOperation call() {
return new LegacyReadFilesystemOperation(okHttpClient, activeUser, url, 0);
public ReadFilesystemOperation call() {
return new ReadFilesystemOperation(okHttpClient, activeUser, url, 0);
}
}).observeOn(Schedulers.io())
.subscribe(new SingleObserver<LegacyReadFilesystemOperation>() {
.subscribe(new SingleObserver<ReadFilesystemOperation>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
// unused atm
}
@Override
public void onSuccess(@NonNull LegacyReadFilesystemOperation readFilesystemOperation) {
public void onSuccess(@NonNull ReadFilesystemOperation readFilesystemOperation) {
DavResponse davResponse = readFilesystemOperation.readRemotePath();
if (davResponse.data != null) {
List<BrowserFile> browserFileList = (List<BrowserFile>) davResponse.data;

View File

@ -26,7 +26,7 @@ import android.util.Log;
import com.nextcloud.talk.components.filebrowser.interfaces.ListingInterface;
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 java.util.concurrent.Callable;
@ -50,20 +50,20 @@ public class DavListing extends ListingAbstractClass {
@Override
public void getFiles(String path, UserEntity currentUser, @Nullable OkHttpClient okHttpClient) {
Single.fromCallable(new Callable<LegacyReadFilesystemOperation>() {
Single.fromCallable(new Callable<ReadFilesystemOperation>() {
@Override
public LegacyReadFilesystemOperation call() {
return new LegacyReadFilesystemOperation(okHttpClient, currentUser, path, 1);
public ReadFilesystemOperation call() {
return new ReadFilesystemOperation(okHttpClient, currentUser, path, 1);
}
}).subscribeOn(Schedulers.io())
.subscribe(new SingleObserver<LegacyReadFilesystemOperation>() {
.subscribe(new SingleObserver<ReadFilesystemOperation>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onSuccess(@NonNull LegacyReadFilesystemOperation readFilesystemOperation) {
public void onSuccess(@NonNull ReadFilesystemOperation readFilesystemOperation) {
davResponse = readFilesystemOperation.readRemotePath();
try {
listingInterface.listingResult(davResponse);

View File

@ -40,15 +40,14 @@ import kotlin.jvm.functions.Function2;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
@Deprecated
public class LegacyReadFilesystemOperation {
public class ReadFilesystemOperation {
private static final String TAG = "ReadFilesystemOperation";
private final OkHttpClient okHttpClient;
private final String url;
private final int depth;
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();
okHttpClientBuilder.followRedirects(false);
okHttpClientBuilder.followSslRedirects(false);
@ -92,7 +91,7 @@ public class LegacyReadFilesystemOperation {
}
});
} catch (IOException | DavException e) {
Log.w("", "Error reading remote path");
Log.w(TAG, "Error reading remote path");
}
remoteFiles.add(BrowserFile.Companion.getModelFromResponse(rootElement[0],