updates for ignoring placeholder paths

This commit is contained in:
Greg DiCristofaro 2023-08-22 11:45:11 -04:00
parent 9e4c0b9801
commit 2de8646ba7

View File

@ -194,6 +194,8 @@ public class Case {
private final SleuthkitEventListener sleuthkitEventListener;
private CollaborationMonitor collaborationMonitor;
private Services caseServices;
// matches something like '\\.\PHYSICALDRIVE0'
private static final String PLACEHOLDER_DS_PATH_REGEX = "^\\s*\\\\\\\\\\.\\\\(PHYSICALDRIVE)\\d*\\s*$";
private volatile boolean hasDataSource = false;
private volatile boolean hasData = false;
@ -1305,6 +1307,13 @@ public class Case {
String path = entry.getValue();
boolean fileExists = (new File(path).isFile() || DriveUtils.driveExists(path));
if (!fileExists) {
// CT-7336: ignore relocating datasources if file provider is present and placeholder path is used.
if (newCurrentCase.getMetadata() != null
&& !StringUtils.isBlank(newCurrentCase.getMetadata().getContentProviderName())
&& (path == null || path.matches(PLACEHOLDER_DS_PATH_REGEX))) {
continue;
}
try {
// Using invokeAndWait means that the dialog will
// open on the EDT but this thread will wait for an