Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
eDrive
Commits
6a6b61e1
Commit
6a6b61e1
authored
Nov 15, 2021
by
narinder Rana
Browse files
resolved missing function in LightReadFolderRemoteOperation class
parent
fbe5f7d3
Pipeline
#146258
failed with stages
in 2 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/drive/utils/ncLib/LightReadFolderRemoteOperation.java
View file @
6a6b61e1
...
@@ -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
.
get
Webd
avUri
()
+
WebdavUtils
.
encodePath
(
mRemotePath
),
propfind
=
new
GzipedPropfind
(
client
.
get
D
avUri
()
+
WebdavUtils
.
encodePath
(
mRemotePath
),
WebdavUtils
.
get
Minimum
PropSet
(),
// PropFind Properties
WebdavUtils
.
get
All
PropSet
(),
// 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
.
get
Webd
avUri
()
+
WebdavUtils
.
encodePath
(
mRemotePath
),
propfind
=
new
PropFindMethod
(
client
.
get
D
avUri
()
+
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
.
get
Webd
avUri
().
getPath
());
WebdavEntry
we
=
new
WebdavEntry
(
remoteData
.
getResponses
()[
0
],
client
.
get
D
avUri
().
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
.
get
Webd
avUri
().
getPath
());
we
=
new
WebdavEntry
(
remoteData
.
getResponses
()[
i
],
client
.
get
D
avUri
().
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
.
c
ontentLength
());
file
.
setLength
(
we
.
getC
ontentLength
());
file
.
setMimeType
(
we
.
c
ontentType
());
file
.
setMimeType
(
we
.
getC
ontentType
());
file
.
setModifiedTimestamp
(
we
.
m
odifiedTimestamp
());
file
.
setModifiedTimestamp
(
we
.
getM
odifiedTimestamp
());
file
.
setEtag
(
we
.
etag
());
file
.
setEtag
(
we
.
g
et
ET
ag
());
file
.
setPermissions
(
we
.
p
ermissions
());
file
.
setPermissions
(
we
.
getP
ermissions
());
file
.
setRemoteId
(
we
.
r
emoteId
());
file
.
setRemoteId
(
we
.
getR
emoteId
());
file
.
setSize
(
we
.
s
ize
());
file
.
setSize
(
we
.
getS
ize
());
return
file
;
return
file
;
}
}
}
}
app/src/main/java/foundation/e/drive/utils/ncLib/common/method/Common.java
0 → 100644
View file @
6a6b61e1
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
();
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment