mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Fix a bug during end-to-end test. Test for .vhd file instead of sparse_image.vhd
This commit is contained in:
parent
5078652f70
commit
eeb85baa89
@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.casemodule;
|
|||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FilenameFilter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.FileStore;
|
import java.nio.file.FileStore;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
@ -302,8 +303,7 @@ public class LogicalImagerPanel extends JPanel implements DocumentListener {
|
|||||||
|
|
||||||
@Messages({
|
@Messages({
|
||||||
"# {0} - sparseImageDirectory",
|
"# {0} - sparseImageDirectory",
|
||||||
"# {1} - image",
|
"LogicalImagerPanel.messageLabel.directoryDoesNotContainSparseImage=Directory {0} does not contain any images",
|
||||||
"LogicalImagerPanel.messageLabel.directoryDoesNotContainSparseImage=Directory {0} does not contain {1}",
|
|
||||||
"# {0} - invalidFormatDirectory",
|
"# {0} - invalidFormatDirectory",
|
||||||
"LogicalImagerPanel.messageLabel.directoryFormatInvalid=Directory {0} does not match format Logical_Imager_HOSTNAME_yyyymmdd_HH_MM_SS"
|
"LogicalImagerPanel.messageLabel.directoryFormatInvalid=Directory {0} does not match format Logical_Imager_HOSTNAME_yyyymmdd_HH_MM_SS"
|
||||||
})
|
})
|
||||||
@ -317,9 +317,15 @@ public class LogicalImagerPanel extends JPanel implements DocumentListener {
|
|||||||
String path = fileChooser.getSelectedFile().getPath();
|
String path = fileChooser.getSelectedFile().getPath();
|
||||||
Matcher m = regex.matcher(path);
|
Matcher m = regex.matcher(path);
|
||||||
if (m.find()) {
|
if (m.find()) {
|
||||||
Path vhdPath = Paths.get(path, SPARSE_IMAGE_VHD);
|
File dir = Paths.get(path).toFile();
|
||||||
if (!vhdPath.toFile().exists()) {
|
String[] vhdFiles = dir.list(new FilenameFilter() {
|
||||||
setErrorMessage(Bundle.LogicalImagerPanel_messageLabel_directoryDoesNotContainSparseImage(path, SPARSE_IMAGE_VHD));
|
@Override
|
||||||
|
public boolean accept(File dir, String name) {
|
||||||
|
return name.endsWith(".vhd");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (vhdFiles.length == 0) {
|
||||||
|
setErrorMessage(Bundle.LogicalImagerPanel_messageLabel_directoryDoesNotContainSparseImage(path));
|
||||||
firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), true, false);
|
firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), true, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user