| 143 | } |
| 144 | |
| 145 | private List<DavResource> getList(Drive drive, String path, List<String> ext) throws IOException { |
| 146 | path = drive.getHost() + (path.startsWith(drive.getPath()) ? path : drive.getPath() + path); |
| 147 | List<DavResource> items = drive.getWebdav().list(path); |
| 148 | items.remove(0); //Remove parent |
| 149 | Iterator<DavResource> iterator = items.iterator(); |
| 150 | while (iterator.hasNext()) { |
| 151 | DavResource item = iterator.next(); |
| 152 | if (!item.isDirectory() && !item.getName().contains(".")) iterator.remove(); |
| 153 | if (!item.isDirectory() && !ext.contains(getExt(item))) iterator.remove(); |
| 154 | } |
| 155 | return items; |
| 156 | } |
| 157 | |
| 158 | private List<DavResource> getSubs(List<DavResource> items) { |
| 159 | List<DavResource> subs = new ArrayList<>(); |