19 package org.sleuthkit.autopsy.ingest;
21 import java.util.Objects;
30 final class FileIngestTask
extends IngestTask {
32 private final long fileId;
33 private AbstractFile file;
43 FileIngestTask(IngestJobExecutor ingestJobPipeline, AbstractFile file) {
44 super(file.getName(), ingestJobPipeline);
46 fileId = file.getId();
59 FileIngestTask(IngestJobExecutor ingestJobPipeline,
long fileId) {
60 super(
"", ingestJobPipeline);
81 synchronized AbstractFile getFile() throws TskCoreException {
83 file = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(fileId);
85 setContentName(file.getName());
92 void execute(
long threadId) {
93 super.setThreadId(threadId);
94 getIngestJobExecutor().execute(
this);
98 public boolean equals(Object obj) {
102 if (getClass() != obj.getClass()) {
105 FileIngestTask other = (FileIngestTask) obj;
106 IngestJobExecutor thisPipeline = getIngestJobExecutor();
107 IngestJobExecutor otherPipeline = other.getIngestJobExecutor();
108 if (thisPipeline != otherPipeline && (thisPipeline == null || !thisPipeline.equals(otherPipeline))) {
111 return (getFileId() == other.getFileId());
115 public int hashCode() {
117 hash = 47 * hash + Objects.hashCode(getIngestJobExecutor());
118 hash = 47 * hash + Objects.hashCode(getFileId());