Go to the documentation of this file.
19package org.sleuthkit.autopsy.coreutils;
21import org.sleuthkit.datamodel.SleuthkitJNI;
22import java.io.IOException;
23import java.nio.file.Path;
24import java.text.MessageFormat;
25import java.util.logging.Level;
26import org.apache.commons.lang3.StringUtils;
46 return SleuthkitJNI.isImageSupported(dataSourcePath.toString());
61 public static boolean imageHasFileSystem(Path dataSourcePath, String password)
throws IOException {
63 SleuthkitJNI.TestOpenImageResult openImageResult = SleuthkitJNI.testOpenImage(dataSourcePath.toString(), password);
64 if (openImageResult.wasSuccessful()) {
67 String message = MessageFormat.format(
"An error occurred while opening {0}: {1}",
68 dataSourcePath.toString(),
69 openImageResult ==
null || StringUtils.isBlank(openImageResult.getMessage())
71 : openImageResult.getMessage());
72 logger.log(Level.INFO, message);
75 }
catch (Throwable ex) {
76 String message =
"An error occurred while opening " + dataSourcePath.toString();
77 logger.log(Level.WARNING, message);
static boolean imageHasFileSystem(Path dataSourcePath)
static boolean imageHasFileSystem(Path dataSourcePath, String password)
static final Logger logger
synchronized static Logger getLogger(String name)
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.