mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-27 08:55:54 +03:00
replace printStackTrace with Log-statement
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
5e88dc6f57
commit
c47a686db1
1 changed files with 13 additions and 7 deletions
|
@ -20,6 +20,8 @@
|
|||
|
||||
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.DavResponse;
|
||||
import com.nextcloud.talk.dagger.modules.RestModule;
|
||||
|
@ -39,6 +41,7 @@ import okhttp3.HttpUrl;
|
|||
import okhttp3.OkHttpClient;
|
||||
|
||||
public class ReadFilesystemOperation {
|
||||
private static final String TAG = "ReadFilesystemOperation";
|
||||
private final OkHttpClient okHttpClient;
|
||||
private final String url;
|
||||
private final int depth;
|
||||
|
@ -48,7 +51,14 @@ public class ReadFilesystemOperation {
|
|||
OkHttpClient.Builder okHttpClientBuilder = okHttpClient.newBuilder();
|
||||
okHttpClientBuilder.followRedirects(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.basePath = currentUser.getBaseUrl() + DavUtils.DAV_PATH + currentUser.getUserId();
|
||||
this.url = basePath + path;
|
||||
|
@ -80,13 +90,10 @@ public class ReadFilesystemOperation {
|
|||
return Unit.INSTANCE;
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (DavException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException | DavException e) {
|
||||
Log.w("", "Error reading remote path");
|
||||
}
|
||||
|
||||
|
||||
remoteFiles.add(BrowserFile.getModelFromResponse(rootElement[0],
|
||||
rootElement[0].getHref().toString().substring(basePath.length())));
|
||||
for (Response memberElement : memberElements) {
|
||||
|
@ -97,5 +104,4 @@ public class ReadFilesystemOperation {
|
|||
davResponse.setData(remoteFiles);
|
||||
return davResponse;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue