mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-16 17:57:43 +00:00
Bug fixes
This commit is contained in:
parent
acc216b549
commit
8dc3288b0a
@ -131,7 +131,7 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
|
||||
// write the vm file to output folder
|
||||
try {
|
||||
writeVirtualMachineToDisk(vmFile, outputFolderForThisVM);
|
||||
} catch (IOException ex) {
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, String.format("Failed to write virtual machine file %s (id=%d) to disk", vmFile.getName(), vmFile.getId()), ex);
|
||||
MessageNotifyUtil.Notify.error("Failed to extract virtual machine file", String.format("Failed to write virtual machine file %s to disk", vmFile.getName()));
|
||||
}
|
||||
@ -186,6 +186,12 @@ final class VMExtractorIngestModule extends DataSourceIngestModuleAdapter {
|
||||
private void writeVirtualMachineToDisk(AbstractFile vmFile, String outputFolderForThisVM) throws IOException {
|
||||
|
||||
// TODO: check available disk space first
|
||||
|
||||
// check if output folder exists
|
||||
File destinationFolder = Paths.get(outputFolderForThisVM).toFile();
|
||||
if (!destinationFolder.exists()) {
|
||||
destinationFolder.mkdirs();
|
||||
}
|
||||
/*
|
||||
* Write the virtual machine file to disk.
|
||||
*/
|
||||
|
@ -193,6 +193,10 @@ public final class VirtualMachineFinderUtility {
|
||||
// only returns files, skips folders
|
||||
File file = new File(path);
|
||||
String[] files = file.list((File current, String name) -> new File(current, name).isFile());
|
||||
if (files == null) {
|
||||
// null is returned when folder doesn't exist. need to check this condition, otherwise there is NullPointerException when converting to List
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return new ArrayList<>(Arrays.asList(files));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user