diff options
author | Mert Tumer <merttumer@outlook.com> | 2016-08-02 18:43:34 +0300 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-09-19 06:12:18 +0000 |
commit | c57e7685f22c4b010a7ddb25fa896f8405e95818 (patch) | |
tree | e47fcd9d63ce255d538288c1b70df318b4155057 /android/source/src | |
parent | 516c0608ba44a60abec3e0a67382e5bc7977316a (diff) |
tdf#101260 - Android: Filter in External SD doesn't work
Change-Id: Iaba74749c11cbac972fecf816e5bb090edd9e06c
Reviewed-on: https://gerrit.libreoffice.org/27802
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'android/source/src')
-rw-r--r-- | android/source/src/java/org/libreoffice/storage/external/ExternalFile.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java b/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java index 638111068ddd..7c7f09fc1ade 100644 --- a/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java +++ b/android/source/src/java/org/libreoffice/storage/external/ExternalFile.java @@ -83,8 +83,22 @@ public class ExternalFile implements IFile{ @Override public List<IFile> listFiles(FileFilter filter) { - // TODO: no filtering yet + File file; + try{ + List<IFile> children = new ArrayList<IFile>(); + for (DocumentFile child : docFile.listFiles()) { + file = new File(new URI(child.getUri().toString())); + if(filter.accept(file)) + children.add(new ExternalFile(provider, child, context)); + } + return children; + + }catch (Exception e){ + e.printStackTrace(); + } + /* if something goes wrong */ return listFiles(); + } @Override |