summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudFile.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudFile.java b/android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudFile.java
index 73b3b2c6205d..c218961a2266 100644
--- a/android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudFile.java
+++ b/android/source/src/java/org/libreoffice/storage/owncloud/OwnCloudFile.java
@@ -93,8 +93,33 @@ public class OwnCloudFile implements IFile {
@Override
public List<IFile> listFiles(FileFilter filter) {
- // TODO no filtering yet
- return listFiles();
+ List<IFile> children = new ArrayList<IFile>();
+ if (isDirectory()) {
+ ReadRemoteFolderOperation refreshOperation = new ReadRemoteFolderOperation(
+ file.getRemotePath());
+ RemoteOperationResult result = refreshOperation.execute(provider
+ .getClient());
+ if (!result.isSuccess()) {
+ throw provider.buildRuntimeExceptionForResultCode(result.getCode());
+ }
+
+ for (Object obj : result.getData()) {
+ RemoteFile child = (RemoteFile) obj;
+ if (!child.getRemotePath().equals(file.getRemotePath())){
+ OwnCloudFile ownCloudFile = new OwnCloudFile(provider, child);
+ if(!ownCloudFile.isDirectory()){
+ File f = new File(provider.getCacheDir().getAbsolutePath(),
+ ownCloudFile.getName());
+ if(filter.accept(f))
+ children.add(ownCloudFile);
+ f.delete();
+ }else{
+ children.add(ownCloudFile);
+ }
+ }
+ }
+ }
+ return children;
}
@Override