Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Replace network library #192

Merged
merged 133 commits into from
Oct 9, 2018
Merged

Replace network library #192

merged 133 commits into from
Oct 9, 2018

Conversation

davigonz
Copy link
Contributor

@davigonz davigonz commented Jun 7, 2018

Implements #51
Needs owncloud/android#2236

@davigonz davigonz self-assigned this Jun 7, 2018
@davigonz davigonz force-pushed the replace_network_library branch from 0b5ea8e to 7274358 Compare June 12, 2018 15:42
@theScrabi theScrabi force-pushed the replace_network_library branch from b736484 to cbbdc2c Compare June 13, 2018 12:14
@davigonz davigonz force-pushed the replace_network_library branch from cbbdc2c to 868079e Compare June 13, 2018 15:15
@davigonz davigonz force-pushed the replace_network_library branch 2 times, most recently from 01d5993 to 7529026 Compare June 29, 2018 12:20
@davigonz davigonz force-pushed the replace_network_library branch from f890d8f to 4cbfc4a Compare July 18, 2018 09:49
build.gradle Outdated
api project(':dav4android')

// Used for network and database debuging
debugApi 'com.facebook.stetho:stetho:1.5.0'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete Stetho, with Android Studio network profiler is enough

android:screenOrientation="portrait"
>
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<activity android:name="MainActivity"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent this properly

import com.owncloud.android.lib.common.http.HttpClient;
import com.owncloud.android.lib.common.http.HttpConstants;
import com.owncloud.android.lib.common.http.methods.HttpBaseMethod;
import com.owncloud.android.lib.common.http.methods.webdav.CopyMethod;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import not used

import java.util.List;

import at.bitfire.dav4android.exception.HttpException;
import at.bitfire.dav4android.exception.RedirectException;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither this

PARAM_SINGLE_COOKIE_HEADER, // to avoid problems with some web servers
PARAM_SINGLE_COOKIE_HEADER_VALUE
);
//TODO
Copy link
Contributor Author

@davigonz davigonz Aug 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if this is implemented somewhere else and delete it if so

@@ -24,16 +24,15 @@

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update copyright year

@@ -31,21 +31,21 @@
import com.owncloud.android.lib.common.authentication.OwnCloudBasicCredentials;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, including authors

@@ -26,19 +26,22 @@
import com.owncloud.android.lib.common.authentication.OwnCloudBasicCredentials;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

OwnCloudCredentials oldCredentials = switchClientCredentials(oauthCredentials);

client.executeMethod(postMethod);
final OwnCloudCredentials oauthCredentials =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fits properly in the same line

return mCall.isCanceled();
}


Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much space here

@@ -41,12 +41,6 @@
import javax.net.ssl.TrustManagerFactory;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update copyright year in all test classes

get = new GetMethod(client.getBaseUri() + OCS_ROUTE);
get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE);
status = client.executeMethod(get);
final Request request = new Request.Builder()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This request is not being used


import java.net.URL;

import okhttp3.Request;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed since due to next comment

import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.http.HttpConstants;
import com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod;
import com.owncloud.android.lib.common.network.WebdavUtils;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much space here

result = new RemoteOperationResult(false, get);
client.exhaustResponse(get.getResponseBodyAsStream());
result = new RemoteOperationResult<>(getMethod);
client.exhaustResponse(getMethod.getResponseAsStream());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getResponseAsStream => getResponseBodyAsStream

@@ -1,140 +1,138 @@
/* ownCloud Android Library is available under MIT license
* Copyright (C) 2016 ownCloud GmbH.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this year

@@ -87,39 +92,38 @@ protected RemoteOperationResult run(OwnCloudClient client) {
}

} else {
result = new RemoteOperationResult(ResultCode.INVALID_CHARACTER_IN_NAME);
result = new RemoteOperationResult<>(ResultCode.INVALID_CHARACTER_IN_NAME);
}

return result;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much space here

* @throws org.apache.jackrabbit.webdav.DavException If the status code is other than MultiStatus or if obtaining
* the response XML document fails
*/
private RemoteOperationResult processPartialError(CopyMethod copyMethod)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a look at this

@@ -27,25 +27,21 @@
import android.util.Log;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update copyright year

@@ -1,29 +1,16 @@
/* ownCloud Android Library is available under MIT license
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include this again

@davigonz davigonz force-pushed the replace_network_library branch from f4aba99 to 4d2d584 Compare August 7, 2018 15:24
@davigonz davigonz changed the title [WIP] Replace network library Replace network library Aug 7, 2018
mModificationTimestamp = (d != null) ? d.getTime() : 0;
} else {
Log_OC.e(TAG, "Could not read modification time from response downloading " + mRemotePath);
}

mEtag = WebdavUtils.getEtagFromResponse(mGet);
// TODO mEtag = WebdavUtils.getEtagFromResponse(mGet);
if (mEtag.length() == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It always will be zero. Don't you nedd implement TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me check...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will implement the TODO

@jabarros
Copy link
Contributor

jabarros commented Aug 9, 2018

LGTM

@davigonz davigonz force-pushed the replace_network_library branch from b0b83ce to 8e30a3b Compare August 30, 2018 09:04
@davigonz davigonz force-pushed the replace_network_library branch from ab2cd1a to eaa645a Compare September 4, 2018 14:04
@davigonz davigonz merged commit 2fdf724 into master Oct 9, 2018
@theScrabi
Copy link
Contributor

party

@JuancaG05 JuancaG05 deleted the replace_network_library branch May 30, 2023 14:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants