Browse Source

Rename ReadFilesystemOperation

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 3 years ago
parent
commit
7f85a2f228

+ 6 - 6
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicPreviewMessageViewHolder.java

@@ -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;

+ 6 - 6
app/src/main/java/com/nextcloud/talk/components/filebrowser/operations/DavListing.java

@@ -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);

+ 3 - 4
app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/LegacyReadFilesystemOperation.java → app/src/main/java/com/nextcloud/talk/components/filebrowser/webdav/ReadFilesystemOperation.java

@@ -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],