80 final SleuthkitCase caseDb = thumbnailRequest.getSleuthkitCase();
82 caseDb, thumbnailRequest.getDomain(), TSK_WEB_DOWNLOAD);
83 final List<BlackboardArtifact> webDownloads =
artifactsCache.get(webDownloadsRequest);
85 Collections.sort(webDownloadPictures, (file1, file2) -> {
89 return Long.compare(file1.getSize(), file2.getSize());
90 }
else if (
isIco(file1)) {
92 }
else if (
isIco(file2)) {
95 return Long.compare(file1.getCrtime(), file2.getCrtime());
99 for (
int i = webDownloadPictures.size() - 1; i >= 0; i--) {
100 if(Thread.currentThread().isInterrupted()) {
101 throw new InterruptedException();
104 final AbstractFile mostRecent = webDownloadPictures.get(i);
108 return candidateThumbnail;
112 caseDb, thumbnailRequest.getDomain(), TSK_WEB_CACHE);
113 final List<BlackboardArtifact> webCacheArtifacts =
artifactsCache.get(webCacheRequest);
115 Collections.sort(webCachePictures, (file1, file2) -> {
119 return Long.compare(file1.getSize(), file2.getSize());
120 }
else if (
isIco(file1)) {
122 }
else if (
isIco(file2)) {
125 return Long.compare(file1.getSize(), file2.getSize());
128 for (
int i = webCachePictures.size() - 1; i >= 0; i--) {
129 if(Thread.currentThread().isInterrupted()) {
130 throw new InterruptedException();
133 final AbstractFile largest = webCachePictures.get(i);
136 return candidateThumbnail;
153 private List<AbstractFile>
getCandidatesFromWebDownloads(SleuthkitCase caseDb, List<BlackboardArtifact> artifacts)
throws TskCoreException, InterruptedException {
154 final List<AbstractFile> candidates =
new ArrayList<>();
155 for (BlackboardArtifact artifact : artifacts) {
156 if(Thread.currentThread().isInterrupted()) {
157 throw new InterruptedException();
159 final Content sourceContent = caseDb.getContentById(artifact.getObjectID());
179 private List<AbstractFile>
getCandidatesFromWebCache(SleuthkitCase caseDb, List<BlackboardArtifact> artifacts)
throws TskCoreException, InterruptedException {
180 final BlackboardAttribute.Type TSK_PATH_ID =
new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PATH_ID);
181 final List<AbstractFile> candidates =
new ArrayList<>();
182 for (BlackboardArtifact artifact : artifacts) {
183 if(Thread.currentThread().isInterrupted()) {
184 throw new InterruptedException();
186 final BlackboardAttribute tskPathId = artifact.getAttribute(TSK_PATH_ID);
187 if (tskPathId !=
null) {
188 final Content sourceContent = caseDb.getContentById(tskPathId.getValueLong());
202 if ((sourceContent instanceof AbstractFile) && !(sourceContent instanceof DataSource)) {
203 final AbstractFile file = (AbstractFile) sourceContent;