mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Merge branch 'develop' of https://github.com/sleuthkit/autopsy into 1205-download-source
This commit is contained in:
commit
49732b1dfc
@ -552,12 +552,13 @@ final class ChromeCacheExtractor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AbstractFile cacheFile = cacheFileOptional.get();
|
AbstractFile cacheFile = cacheFileOptional.get();
|
||||||
|
RandomAccessFile randomAccessFile = null;
|
||||||
String tempFilePathname = RAImageIngestModule.getRATempPath(currentCase, moduleName) + cachePath + cacheFile.getName(); //NON-NLS
|
String tempFilePathname = RAImageIngestModule.getRATempPath(currentCase, moduleName) + cachePath + cacheFile.getName(); //NON-NLS
|
||||||
try {
|
try {
|
||||||
File newFile = new File(tempFilePathname);
|
File newFile = new File(tempFilePathname);
|
||||||
ContentUtils.writeToFile(cacheFile, newFile, context::dataSourceIngestIsCancelled);
|
ContentUtils.writeToFile(cacheFile, newFile, context::dataSourceIngestIsCancelled);
|
||||||
|
|
||||||
RandomAccessFile randomAccessFile = new RandomAccessFile(tempFilePathname, "r");
|
randomAccessFile = new RandomAccessFile(tempFilePathname, "r");
|
||||||
FileChannel roChannel = randomAccessFile.getChannel();
|
FileChannel roChannel = randomAccessFile.getChannel();
|
||||||
ByteBuffer cacheFileROBuf = roChannel.map(FileChannel.MapMode.READ_ONLY, 0,
|
ByteBuffer cacheFileROBuf = roChannel.map(FileChannel.MapMode.READ_ONLY, 0,
|
||||||
(int) roChannel.size());
|
(int) roChannel.size());
|
||||||
@ -571,12 +572,17 @@ final class ChromeCacheExtractor {
|
|||||||
|
|
||||||
return Optional.of(cacheFileCopy);
|
return Optional.of(cacheFileCopy);
|
||||||
}
|
}
|
||||||
catch (ReadContentInputStream.ReadContentInputStreamException ex) {
|
catch (IOException ex) {
|
||||||
String msg = String.format("Error reading Chrome cache file '%s' (id=%d).", //NON-NLS
|
|
||||||
cacheFile.getName(), cacheFile.getId());
|
try {
|
||||||
throw new IngestModuleException(msg, ex);
|
if (randomAccessFile != null) {
|
||||||
} catch (IOException ex) {
|
randomAccessFile.close();
|
||||||
String msg = String.format("Error writing temp Chrome cache file '%s' (id=%d).", //NON-NLS
|
}
|
||||||
|
}
|
||||||
|
catch (IOException ex2) {
|
||||||
|
logger.log(Level.SEVERE, "Error while trying to close temp file after exception.", ex2); //NON-NLS
|
||||||
|
}
|
||||||
|
String msg = String.format("Error reading/copying Chrome cache file '%s' (id=%d).", //NON-NLS
|
||||||
cacheFile.getName(), cacheFile.getId());
|
cacheFile.getName(), cacheFile.getId());
|
||||||
throw new IngestModuleException(msg, ex);
|
throw new IngestModuleException(msg, ex);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user