List<StagingFolderEntry> folderEntries = new ArrayList<StagingFolderEntry>();
for (IPath folderPath : folderPaths) {
IPath parent = folderPath.removeLastSegments(1);
// Find first existing parent node, but stop at root
while (parent.segmentCount() != 0 && !folderPaths.contains(parent))
parent = parent.removeLastSegments(1);
if (parent.segmentCount() == 0) {
// Parent is root
StagingFolderEntry folderEntry = new StagingFolderEntry(
workingDirectory, folderPath, folderPath);
folderEntries.add(folderEntry);