Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

resolved missing function in LightReadFolderRemoteOperation class

parent fbe5f7d3
Loading
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;

import java.util.ArrayList;

import foundation.e.drive.utils.ncLib.common.method.Common;
import foundation.e.drive.utils.ncLib.common.method.GzipedPropfind;


@@ -57,18 +58,17 @@ public class LightReadFolderRemoteOperation extends RemoteOperation {
        try {
            // remote request
            if(allowGzip){
                propfind = new GzipedPropfind(client.getWebdavUri() + WebdavUtils.encodePath(mRemotePath),
                        WebdavUtils.getMinimumPropSet(),    // PropFind Properties
                propfind = new GzipedPropfind(client.getDavUri() + WebdavUtils.encodePath(mRemotePath),
                        WebdavUtils.getAllPropSet(),    // PropFind Properties
                        this.depth);
                propfind.setRequestHeader("Accept-Encoding", "gzip");
                userAgent = "gzipUserAgent";
            }else{
                propfind = new PropFindMethod(client.getWebdavUri() + WebdavUtils.encodePath(mRemotePath),
                propfind = new PropFindMethod(client.getDavUri() + WebdavUtils.encodePath(mRemotePath),
                        WebdavUtils.getAllPropSet(),    // PropFind Properties
                        this.depth);
            }

            int status = client.executeMethod(propfind, userAgent);
            int status = client.executeMethod(propfind);
            // check and process response
            boolean isSuccess = (status == HttpStatus.SC_MULTI_STATUS || status == HttpStatus.SC_OK);

@@ -121,14 +121,14 @@ public class LightReadFolderRemoteOperation extends RemoteOperation {
        mFolderAndFiles = new ArrayList<>();

        // 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));

        // loop to update every child
        RemoteFile remoteFile;
        for (int i =0 ; ++i < remoteData.getResponses().length;) {
            /// 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);
            mFolderAndFiles.add(remoteFile);
        }
@@ -143,13 +143,13 @@ public class LightReadFolderRemoteOperation extends RemoteOperation {
     */
    private RemoteFile fillOCFile(WebdavEntry we) {
        RemoteFile file = new RemoteFile(we.decodedPath());
        file.setLength(we.contentLength());
        file.setMimeType(we.contentType());
        file.setModifiedTimestamp(we.modifiedTimestamp());
        file.setEtag(we.etag());
        file.setPermissions(we.permissions());
        file.setRemoteId(we.remoteId());
        file.setSize(we.size());
        file.setLength(we.getContentLength());
        file.setMimeType(we.getContentType());
        file.setModifiedTimestamp(we.getModifiedTimestamp());
        file.setEtag(we.getETag());
        file.setPermissions(we.getPermissions());
        file.setRemoteId(we.getRemoteId());
        file.setSize(we.getSize());
        return file;
    }
}
+23 −0
Original line number Diff line number Diff line
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();


}