Loading app/src/main/java/foundation/e/drive/utils/ncLib/LightReadFolderRemoteOperation.java +14 −14 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading Loading @@ -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); } Loading @@ -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; } } app/src/main/java/foundation/e/drive/utils/ncLib/common/method/Common.java 0 → 100644 +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(); } Loading
app/src/main/java/foundation/e/drive/utils/ncLib/LightReadFolderRemoteOperation.java +14 −14 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading Loading @@ -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); } Loading @@ -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; } }
app/src/main/java/foundation/e/drive/utils/ncLib/common/method/Common.java 0 → 100644 +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(); }