Autopsy  4.6.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
FileIngestTask.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2012-2015 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.ingest;
20 
21 import java.util.Objects;
22 import org.sleuthkit.datamodel.AbstractFile;
23 
28 final class FileIngestTask extends IngestTask {
29 
30  private final AbstractFile file;
31 
32  FileIngestTask(DataSourceIngestJob job, AbstractFile file) {
33  super(job);
34  this.file = file;
35  }
36 
37  AbstractFile getFile() {
38  return file;
39  }
40 
41  @Override
42  void execute(long threadId) throws InterruptedException {
43  super.setThreadId(threadId);
44  getIngestJob().process(this);
45  }
46 
47  @Override
48  public boolean equals(Object obj) {
49  if (obj == null) {
50  return false;
51  }
52  if (getClass() != obj.getClass()) {
53  return false;
54  }
55  FileIngestTask other = (FileIngestTask) obj;
56  DataSourceIngestJob job = getIngestJob();
57  DataSourceIngestJob otherJob = other.getIngestJob();
58  if (job != otherJob && (job == null || !job.equals(otherJob))) {
59  return false;
60  }
61  if (this.file != other.file && (this.file == null || !this.file.equals(other.file))) {
62  return false;
63  }
64  return true;
65  }
66 
67  @Override
68  public int hashCode() {
69  int hash = 5;
70  hash = 47 * hash + Objects.hashCode(getIngestJob());
71  hash = 47 * hash + Objects.hashCode(this.file);
72  return hash;
73  }
74 }

Copyright © 2012-2016 Basis Technology. Generated on: Mon May 7 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.