use of org.kie.workbench.common.screens.explorer.model.FolderItem in project kie-wb-common by kiegroup.
the class ExplorerServiceHelper method getItems.
private List<FolderItem> getItems(final Path packagePath, final ActiveOptions options) {
final List<FolderItem> folderItems = new ArrayList<FolderItem>();
final boolean includeTags = options.contains(Option.SHOW_TAG_FILTER);
final org.uberfire.java.nio.file.Path nioPackagePath = Paths.convert(packagePath);
if (Files.exists(nioPackagePath)) {
final DirectoryStream<org.uberfire.java.nio.file.Path> nioPaths = ioService.newDirectoryStream(nioPackagePath, regularFileFilter);
for (org.uberfire.java.nio.file.Path nioPath : nioPaths) {
final org.uberfire.backend.vfs.Path path = Paths.convert(nioPath);
if (Paths.isLock(path)) {
continue;
}
final String lockedBy = Paths.readLockedBy(path);
final FolderItem folderItem = new FolderItem(path, path.getFileName(), FolderItemType.FILE, false, lockedBy, includeTags ? metadataService.getTags(path) : Collections.<String>emptyList(), getRestrictedOperations(path));
folderItems.add(folderItem);
}
}
return folderItems;
}
Aggregations