bug fixes

This commit is contained in:
Greg DiCristofaro 2022-01-20 21:10:25 -05:00
parent 3001177665
commit 04d799a822
2 changed files with 13 additions and 6 deletions

View File

@ -1564,16 +1564,22 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
Node parentNode = null;
Node[] childNodes = emailMsgRootNode.getChildren().getNodes(true);
while (childNodes != null) {
boolean recursing = false;
for (Node child : childNodes) {
if (MainDAO.getInstance().getEmailsDAO().getNextSubFolder(child.getName(), path).isPresent()) {
recursing = true;
parentNode = child;
childNodes = parentNode.getChildren().getNodes(true);
childNodes = child.getChildren().getNodes(true);
break;
}
}
if (!recursing) {
break;
}
}
return null;
return parentNode;
} catch (TskCoreException ex) {
LOGGER.log(Level.WARNING, "Error retrieving attributes", ex); //NON-NLS
return null;

View File

@ -300,7 +300,8 @@ public class EmailsDAO extends AbstractDAO {
return new TreeItemDTO<>(
EmailSearchParams.getTypeId(),
new EmailSearchParams(dataSourceId, normalizedPath),
normalizedPath == null ? 0 : normalizedPath,
// path for id to lower case so case insensitive
normalizedPath == null ? 0 : normalizedPath.toLowerCase(),
displayName,
count
);
@ -330,7 +331,7 @@ public class EmailsDAO extends AbstractDAO {
}
// ensure that child is a sub path of parent
if (normalizedChild.startsWith(normalizedParent)) {
if (normalizedChild.toLowerCase().startsWith(normalizedParent.toLowerCase())) {
int nextDelimiter = normalizedChild.indexOf(PATH_DELIMITER, normalizedParent.length());
return nextDelimiter >= 0
? Optional.of(getNormalizedPath(normalizedChild.substring(0, nextDelimiter + 1)))
@ -472,13 +473,13 @@ public class EmailsDAO extends AbstractDAO {
String rsPath;
if (normalizedParent != null && rsFolderSegment != null) {
// both the parent path and next folder segment are present
rsPath = getNormalizedPath(normalizedParent + rsFolderSegment);
rsPath = getNormalizedPath(normalizedParent + rsFolderSegment + PATH_DELIMITER);
} else if (rsFolderSegment == null) {
// the folder segment is not present
rsPath = getNormalizedPath(normalizedParent);
} else {
// the normalized parent is not present but the folder segment is
rsPath = getNormalizedPath(PATH_DELIMITER + rsFolderSegment);
rsPath = getNormalizedPath(PATH_DELIMITER + rsFolderSegment + PATH_DELIMITER);
}
TreeDisplayCount treeDisplayCount = indeterminateTypes.contains(rsPath)