mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-10 08:00:57 +00:00
replace printStackTrace with Log-statement
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
5e88dc6f57
commit
c47a686db1
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
package com.nextcloud.talk.components.filebrowser.webdav;
|
package com.nextcloud.talk.components.filebrowser.webdav;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
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.dagger.modules.RestModule;
|
import com.nextcloud.talk.dagger.modules.RestModule;
|
||||||
@ -39,6 +41,7 @@ import okhttp3.HttpUrl;
|
|||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
|
|
||||||
public class ReadFilesystemOperation {
|
public class 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;
|
||||||
@ -48,7 +51,14 @@ public class ReadFilesystemOperation {
|
|||||||
OkHttpClient.Builder okHttpClientBuilder = okHttpClient.newBuilder();
|
OkHttpClient.Builder okHttpClientBuilder = okHttpClient.newBuilder();
|
||||||
okHttpClientBuilder.followRedirects(false);
|
okHttpClientBuilder.followRedirects(false);
|
||||||
okHttpClientBuilder.followSslRedirects(false);
|
okHttpClientBuilder.followSslRedirects(false);
|
||||||
okHttpClientBuilder.authenticator(new RestModule.MagicAuthenticator(ApiUtils.getCredentials(currentUser.getUsername(), currentUser.getToken()), "Authorization"));
|
okHttpClientBuilder.authenticator(
|
||||||
|
new RestModule.MagicAuthenticator(
|
||||||
|
ApiUtils.getCredentials(
|
||||||
|
currentUser.getUsername(),
|
||||||
|
currentUser.getToken()
|
||||||
|
),
|
||||||
|
"Authorization")
|
||||||
|
);
|
||||||
this.okHttpClient = okHttpClientBuilder.build();
|
this.okHttpClient = okHttpClientBuilder.build();
|
||||||
this.basePath = currentUser.getBaseUrl() + DavUtils.DAV_PATH + currentUser.getUserId();
|
this.basePath = currentUser.getBaseUrl() + DavUtils.DAV_PATH + currentUser.getUserId();
|
||||||
this.url = basePath + path;
|
this.url = basePath + path;
|
||||||
@ -80,13 +90,10 @@ public class ReadFilesystemOperation {
|
|||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (IOException e) {
|
} catch (IOException | DavException e) {
|
||||||
e.printStackTrace();
|
Log.w("", "Error reading remote path");
|
||||||
} catch (DavException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
remoteFiles.add(BrowserFile.getModelFromResponse(rootElement[0],
|
remoteFiles.add(BrowserFile.getModelFromResponse(rootElement[0],
|
||||||
rootElement[0].getHref().toString().substring(basePath.length())));
|
rootElement[0].getHref().toString().substring(basePath.length())));
|
||||||
for (Response memberElement : memberElements) {
|
for (Response memberElement : memberElements) {
|
||||||
@ -97,5 +104,4 @@ public class ReadFilesystemOperation {
|
|||||||
davResponse.setData(remoteFiles);
|
davResponse.setData(remoteFiles);
|
||||||
return davResponse;
|
return davResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user