mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
2885 Last Accessed time now sourced from last accessed attr instead of modified
This commit is contained in:
parent
93ed39fe79
commit
291e156566
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2015 Basis Technology Corp.
|
||||
* Copyright 2015-2017 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -39,7 +39,7 @@ class AutoIngestCase implements Comparable<AutoIngestCase> {
|
||||
private final String caseName;
|
||||
private final Path metadataFilePath;
|
||||
private final Date createDate;
|
||||
private Date lastModfiedDate;
|
||||
private final Date lastAccessedDate;
|
||||
|
||||
/**
|
||||
* Constructs a representation of case created by automated ingest.
|
||||
@ -58,10 +58,10 @@ class AutoIngestCase implements Comparable<AutoIngestCase> {
|
||||
}
|
||||
if (null != fileAttrs) {
|
||||
createDate = new Date(fileAttrs.creationTime().toMillis());
|
||||
lastModfiedDate = new Date(fileAttrs.lastModifiedTime().toMillis());
|
||||
lastAccessedDate = new Date(fileAttrs.lastAccessTime().toMillis());
|
||||
} else {
|
||||
createDate = new Date();
|
||||
lastModfiedDate = new Date();
|
||||
lastAccessedDate = new Date();
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,19 +94,13 @@ class AutoIngestCase implements Comparable<AutoIngestCase> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last accessed date for the case, defined as the last modified
|
||||
* Gets the last accessed date for the case, defined as the last accessed
|
||||
* time of the case metadata file.
|
||||
*
|
||||
* @return The last accessed date.
|
||||
*/
|
||||
Date getLastAccessedDate() {
|
||||
try {
|
||||
BasicFileAttributes fileAttrs = Files.readAttributes(metadataFilePath, BasicFileAttributes.class);
|
||||
lastModfiedDate = new Date(fileAttrs.lastModifiedTime().toMillis());
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, String.format("Error reading file attributes of case metadata file in %s, lastModfiedDate time not updated", caseDirectoryPath), ex);
|
||||
}
|
||||
return lastModfiedDate;
|
||||
return this.lastAccessedDate;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -162,7 +156,7 @@ class AutoIngestCase implements Comparable<AutoIngestCase> {
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(AutoIngestCase other) {
|
||||
return -this.lastModfiedDate.compareTo(other.getLastAccessedDate());
|
||||
return -this.lastAccessedDate.compareTo(other.getLastAccessedDate());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user