This repository was archived by the owner on Mar 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +6
-73
lines changed
owncloudComLibrary/src/main/java/com/owncloud/android/lib/common
sample_client/src/main/java/com/owncloud/android/lib/sampleclient Expand file tree Collapse file tree 4 files changed +6
-73
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -61,15 +61,14 @@ public class HttpClient {
61
61
private OkHttpClient mOkHttpClient = null ;
62
62
63
63
protected HttpClient (Context context ) {
64
+ if (context == null ) {
65
+ Timber .e ("Context may not be NULL!" );
66
+ throw new NullPointerException ("Context may not be NULL!" );
67
+ }
64
68
mContext = context ;
65
69
}
66
70
67
71
public OkHttpClient getOkHttpClient () {
68
- if (mContext == null ) {
69
- Timber .e ("Context not initialized call HttpClient.setContext(applicationContext) in the MainApp.onCrate()" );
70
- throw new RuntimeException ("Context not initialized call HttpClient.setContext(applicationContext) in the" +
71
- " MainApp.onCrate()" );
72
- }
73
72
if (mOkHttpClient == null ) {
74
73
try {
75
74
final X509TrustManager trustManager = new AdvancedX509TrustManager (
Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ abstract class HttpBaseMethod constructor(url: URL) {
60
60
@Throws(Exception ::class )
61
61
open fun execute (httpClient : HttpClient ): Int {
62
62
val okHttpClient = httpClient.okHttpClient.newBuilder().apply {
63
- retryOnConnectionFailure? .let { retryOnConnectionFailure(it) }
64
- followRedirects? .let { followRedirects(it) }
63
+ retryOnConnectionFailure.let { retryOnConnectionFailure(it) }
64
+ followRedirects.let { followRedirects(it) }
65
65
readTimeoutUnit?.let { unit ->
66
66
readTimeoutVal?.let { readTimeout(it, unit) }
67
67
}
@@ -152,12 +152,7 @@ abstract class HttpBaseMethod constructor(url: URL) {
152
152
// Setter
153
153
// ////////////////////////////
154
154
// Connection parameters
155
- /*
156
- open fun setRetryOnConnectionFailure(retryOnConnectionFailure: Boolean) {
157
- retryOnConnectionFailureVal = true
158
- }
159
155
160
- */
161
156
162
157
open fun setReadTimeout (readTimeout : Long , timeUnit : TimeUnit ) {
163
158
readTimeoutVal = readTimeout
Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ public void onCreate(Bundle savedInstanceState) {
74
74
super .onCreate (savedInstanceState );
75
75
setContentView (R .layout .main );
76
76
77
- Timber .plant (new DebugTree ());
78
77
mHandler = new Handler ();
79
78
80
79
final Uri serverUri = Uri .parse (getString (R .string .server_base_url ));
@@ -86,8 +85,6 @@ public void onCreate(Bundle savedInstanceState) {
86
85
true ,
87
86
SingleSessionManager .getDefaultSingleton ());
88
87
89
- mClient = OwnCloudClientFactory .createOwnCloudClient (serverUri , this , true );
90
-
91
88
mClient .setCredentials (
92
89
OwnCloudCredentialsFactory .newBasicCredentials (
93
90
getString (R .string .username ),
You can’t perform that action at this time.
0 commit comments