Commit 6a6b61e1 authored by narinder Rana's avatar narinder Rana
Browse files

resolved missing function in LightReadFolderRemoteOperation class

parent fbe5f7d3
Pipeline #146258 failed with stages
in 2 minutes and 50 seconds
...@@ -16,6 +16,7 @@ import org.apache.jackrabbit.webdav.client.methods.PropFindMethod; ...@@ -16,6 +16,7 @@ import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
import java.util.ArrayList; import java.util.ArrayList;
import foundation.e.drive.utils.ncLib.common.method.Common;
import foundation.e.drive.utils.ncLib.common.method.GzipedPropfind; import foundation.e.drive.utils.ncLib.common.method.GzipedPropfind;
...@@ -57,18 +58,17 @@ public class LightReadFolderRemoteOperation extends RemoteOperation { ...@@ -57,18 +58,17 @@ public class LightReadFolderRemoteOperation extends RemoteOperation {
try { try {
// remote request // remote request
if(allowGzip){ if(allowGzip){
propfind = new GzipedPropfind(client.getWebdavUri() + WebdavUtils.encodePath(mRemotePath), propfind = new GzipedPropfind(client.getDavUri() + WebdavUtils.encodePath(mRemotePath),
WebdavUtils.getMinimumPropSet(), // PropFind Properties WebdavUtils.getAllPropSet(), // PropFind Properties
this.depth); this.depth);
propfind.setRequestHeader("Accept-Encoding", "gzip"); propfind.setRequestHeader("Accept-Encoding", "gzip");
userAgent = "gzipUserAgent"; userAgent = "gzipUserAgent";
}else{ }else{
propfind = new PropFindMethod(client.getWebdavUri() + WebdavUtils.encodePath(mRemotePath), propfind = new PropFindMethod(client.getDavUri() + WebdavUtils.encodePath(mRemotePath),
WebdavUtils.getAllPropSet(), // PropFind Properties WebdavUtils.getAllPropSet(), // PropFind Properties
this.depth); this.depth);
} }
int status = client.executeMethod(propfind);
int status = client.executeMethod(propfind, userAgent);
// check and process response // check and process response
boolean isSuccess = (status == HttpStatus.SC_MULTI_STATUS || status == HttpStatus.SC_OK); boolean isSuccess = (status == HttpStatus.SC_MULTI_STATUS || status == HttpStatus.SC_OK);
...@@ -121,14 +121,14 @@ public class LightReadFolderRemoteOperation extends RemoteOperation { ...@@ -121,14 +121,14 @@ public class LightReadFolderRemoteOperation extends RemoteOperation {
mFolderAndFiles = new ArrayList<>(); mFolderAndFiles = new ArrayList<>();
// parse data from remote folder // parse data from remote folder
WebdavEntry we = new WebdavEntry(remoteData.getResponses()[0], client.getWebdavUri().getPath()); WebdavEntry we = new WebdavEntry(remoteData.getResponses()[0], client.getDavUri().getPath());
mFolderAndFiles.add(fillOCFile(we)); mFolderAndFiles.add(fillOCFile(we));
// loop to update every child // loop to update every child
RemoteFile remoteFile; RemoteFile remoteFile;
for (int i =0 ; ++i < remoteData.getResponses().length;) { for (int i =0 ; ++i < remoteData.getResponses().length;) {
/// new OCFile instance with the data from the server /// new OCFile instance with the data from the server
we = new WebdavEntry(remoteData.getResponses()[i], client.getWebdavUri().getPath()); we = new WebdavEntry(remoteData.getResponses()[i], client.getDavUri().getPath());
remoteFile = fillOCFile(we); remoteFile = fillOCFile(we);
mFolderAndFiles.add(remoteFile); mFolderAndFiles.add(remoteFile);
} }
...@@ -143,13 +143,13 @@ public class LightReadFolderRemoteOperation extends RemoteOperation { ...@@ -143,13 +143,13 @@ public class LightReadFolderRemoteOperation extends RemoteOperation {
*/ */
private RemoteFile fillOCFile(WebdavEntry we) { private RemoteFile fillOCFile(WebdavEntry we) {
RemoteFile file = new RemoteFile(we.decodedPath()); RemoteFile file = new RemoteFile(we.decodedPath());
file.setLength(we.contentLength()); file.setLength(we.getContentLength());
file.setMimeType(we.contentType()); file.setMimeType(we.getContentType());
file.setModifiedTimestamp(we.modifiedTimestamp()); file.setModifiedTimestamp(we.getModifiedTimestamp());
file.setEtag(we.etag()); file.setEtag(we.getETag());
file.setPermissions(we.permissions()); file.setPermissions(we.getPermissions());
file.setRemoteId(we.remoteId()); file.setRemoteId(we.getRemoteId());
file.setSize(we.size()); file.setSize(we.getSize());
return file; return file;
} }
} }
package foundation.e.drive.utils.ncLib.common.method;
import android.net.Uri;
import android.util.Log;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.utils.Log_OC;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpConnectionManager;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.commons.httpclient.params.HttpParams;
import java.io.IOException;
public class Common {
private int mInstanceNumber = 0;
private static final String TAG = Common.class.getSimpleName();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment