@Test void filterEmptyBundle() { FolderFilter folderFilter = new FolderFilter(); Bundle filteredBundle = new Bundle(); List<Folder> childFolders = folderFilter.filter("/my/folder/path", new FilterConfiguration(), FilterTestUtils.getBundle(), filteredBundle); assertTrue(childFolders.isEmpty()); }
@Override public List<Folder> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { return bundle.getFolderTree().stream() .filter(f -> { String path = bundle.getFolderTree().getFormattedPath(f); return ("/" + path + "/").startsWith(folderPath + "/"); }).collect(Collectors.toList()); }
FolderFilter implements EntityFilter<Folder> { @Override public List<Folder> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { return bundle.getFolderTree().stream() .filter(f -> { String path = bundle.getFolderTree().getFormattedPath(f); return ("/" + path + "/").startsWith(folderPath + "/"); }).collect(Collectors.toList()); } }
FolderFilter implements EntityFilter<Folder> { @Override public List<Folder> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { return bundle.getFolderTree().stream() .filter(f -> { String path = bundle.getFolderTree().getFormattedPath(f); return ("/" + path + "/").startsWith(folderPath + "/"); }).collect(Collectors.toList()); }  }
FolderFilter implements EntityFilter<Folder> { @Override public List<Folder> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { return bundle.getFolderTree().stream() .filter(f -> { String path = bundle.getFolderTree().getFormattedPath(f); return ("/" + path + "/").startsWith(folderPath + "/"); }).collect(Collectors.toList()); }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<Folder> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @SuppressWarnings("squid:S1075") static List<Folder> parentFolders(String folderPath, Bundle bundle); }
FolderFilter implements EntityFilter<Folder> { @Override public List<Folder> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle) { return bundle.getFolderTree().stream() .filter(f -> { String path = bundle.getFolderTree().getFormattedPath(f); return ("/" + path + "/").startsWith(folderPath + "/"); }).collect(Collectors.toList()); }  @Override @NotNull Collection<Class<? extends EntityFilter>> getDependencyEntityFilters(); @Override List<Folder> filter(String folderPath, FilterConfiguration filterConfiguration, Bundle bundle, Bundle filteredBundle); @SuppressWarnings("squid:S1075") static List<Folder> parentFolders(String folderPath, Bundle bundle);  }