Skip to content

Commit

Permalink
do not use context as field
Browse files Browse the repository at this point in the history
Signed-off-by: tobiasKaminsky <[email protected]>
  • Loading branch information
tobiasKaminsky committed Jan 24, 2024
1 parent cd72cda commit fe5b7b4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class OwnCloudClient extends HttpClient {
private OwnCloudCredentials credentials = null;
private int mInstanceNumber;

private final Context context;
private AdvancedX509KeyManager keyManager;

/**
* Constructor
Expand All @@ -85,7 +85,7 @@ public OwnCloudClient(Uri baseUri, HttpConnectionManager connectionMgr, Context
if (baseUri == null) {
throw new IllegalArgumentException("Parameter 'baseUri' cannot be NULL");
}
this.context = context;
this.keyManager = new AdvancedX509KeyManager(context);
nextcloudUriDelegate = new NextcloudUriDelegate(baseUri);

mInstanceNumber = sInstanceCounter++;
Expand Down Expand Up @@ -165,7 +165,7 @@ public int executeMethod(HttpMethodBase method, int readTimeout, int connectionT
if (httpStatus == HttpStatus.SC_BAD_REQUEST) {
URI uri = method.getURI();
Log_OC.e(TAG, "Received http status 400 for " + uri + " -> removing client certificate");
new AdvancedX509KeyManager(context).removeKeys(uri);
keyManager.removeKeys(uri);
}
return httpStatus;
} finally {
Expand Down Expand Up @@ -205,7 +205,7 @@ public int executeMethod(HttpMethod method) throws IOException {
} else if (status == HttpStatus.SC_BAD_REQUEST) {
URI uri = method.getURI();
Log_OC.e(TAG, "Received http status 400 for " + uri + " -> removing client certificate");
new AdvancedX509KeyManager(context).removeKeys(uri);
keyManager.removeKeys(uri);
}

if (followRedirects) {
Expand Down

0 comments on commit fe5b7b4

Please sign in to comment.