Skip to content
Snippets Groups Projects
Commit 62e20d85 authored by Richard Cordovano's avatar Richard Cordovano Committed by APriestman
Browse files

Add interface of addToHashDatabase() API to SleuthkitJNI

parent 4605a5c8
Branches
Tags
No related merge requests found
/*
* Sleuth Kit Data Model
*
* Copyright 2014 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.datamodel;
/**
* Used to pass hashDb information about a particular file from TSK to Autopsy
*/
public class HashEntry {
private String md5Hash;
private String sha1Hash;
private String sha256Hash;
private String fileName;
private String comment;
public HashEntry(String fileName, String md5Hash, String sha1Hash, String sha256Hash, String comment) {
this.fileName = fileName;
this.md5Hash = md5Hash;
this.sha1Hash = sha1Hash;
this.sha256Hash = sha256Hash;
this.comment = comment;
}
public String getMd5Hash() {
return md5Hash;
}
public String getSha1Hash() {
return sha1Hash;
}
public String getSha256Hash() {
return sha256Hash;
}
public String getFileName() {
return fileName;
}
public String getComment() {
return comment;
}
}
......@@ -21,6 +21,7 @@
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
import java.util.TimeZone;
......@@ -686,7 +687,14 @@ public static void addToHashDatabase(String filename, String md5, String sha1, S
hashDbAddEntryNat(filename, md5, sha1, sha256, comment, dbHandle);
}
public static void addToHashDatabase(List<HashEntry> hashes, int dbHandle) throws TskCoreException {
// RJCTODO: Begin transaction
for (HashEntry entry : hashes) {
hashDbAddEntryNat(entry.getFileName(), entry.getMd5Hash(), entry.getSha1Hash(), entry.getSha256Hash(), entry.getComment(), dbHandle);
}
// RJCTODO: end transaction
}
public static boolean isUpdateableHashDatabase(int dbHandle) throws TskCoreException {
return hashDbIsUpdateableNat(dbHandle);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment