mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-23 13:26:15 +03:00
- use v2 network request
- eTag is escaped
This commit is contained in:
parent
669f0b6c83
commit
9ccd66053b
1 changed files with 5 additions and 6 deletions
|
@ -3,8 +3,6 @@ package it.niedermann.owncloud.notes.persistence;
|
|||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.nextcloud.android.sso.aidl.NextcloudRequest;
|
||||
import com.nextcloud.android.sso.api.AidlNetworkRequest;
|
||||
|
@ -28,6 +26,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import androidx.annotation.WorkerThread;
|
||||
import it.niedermann.owncloud.notes.model.CloudNote;
|
||||
import it.niedermann.owncloud.notes.util.ServerResponse.NoteResponse;
|
||||
import it.niedermann.owncloud.notes.util.ServerResponse.NotesResponse;
|
||||
|
@ -189,19 +188,19 @@ public class NotesClient {
|
|||
|
||||
try {
|
||||
Log.v(TAG, "NextcloudRequest: " + nextcloudRequest.toString());
|
||||
Response response = mNextcloudAPI.performNewNetworkRequest(nextcloudRequest);
|
||||
Response response = mNextcloudAPI.performNetworkRequestV2(nextcloudRequest);
|
||||
Log.v(TAG, "NextcloudRequest: " + nextcloudRequest.toString());
|
||||
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getInputStream()));
|
||||
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getBody()));
|
||||
String line;
|
||||
while ((line = rd.readLine()) != null) {
|
||||
result.append(line);
|
||||
}
|
||||
response.getInputStream().close();
|
||||
response.getBody().close();
|
||||
|
||||
String etag = "";
|
||||
AidlNetworkRequest.PlainHeader eTagHeader = response.getPlainHeader(HEADER_KEY_ETAG);
|
||||
if (eTagHeader != null) {
|
||||
etag = Objects.requireNonNull(eTagHeader.getValue());
|
||||
etag = Objects.requireNonNull(eTagHeader.getValue()).replace("\"", "");
|
||||
}
|
||||
|
||||
long lastModified = 0;
|
||||
|
|
Loading…
Reference in a new issue