Skip to content
Snippets Groups Projects
Commit 8b5f7c86 authored by adam-m's avatar adam-m
Browse files

java datamodel fix import warning, adjust queries, now using short/int not longs for types

parent 4dbfa245
Branches
Tags
No related merge requests found
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3"> <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3">
<compilation-unit> <compilation-unit>
<package-root>src</package-root> <package-root>src</package-root>
<classpath mode="compile">lib;lib/diffutils-1.2.1.jar;lib/sqlite-jdbc-3.7.8-SNAPSHOT.jar</classpath> <classpath mode="compile">lib;lib/diffutils-1.2.1.jar;lib/sqlite-jdbc-3.7.8-SNAPSHOT.jar;lib/junit-4.8.2.jar</classpath>
<built-to>build</built-to> <built-to>build</built-to>
<source-level>1.6</source-level> <source-level>1.6</source-level>
</compilation-unit> </compilation-unit>
......
...@@ -1020,7 +1020,7 @@ private ArrayList<BlackboardArtifact> getArtifactsHelper(int artifactTypeID, Str ...@@ -1020,7 +1020,7 @@ private ArrayList<BlackboardArtifact> getArtifactsHelper(int artifactTypeID, Str
try { try {
ArrayList<BlackboardArtifact> artifacts = new ArrayList<BlackboardArtifact>(); ArrayList<BlackboardArtifact> artifacts = new ArrayList<BlackboardArtifact>();
getArtifactsHelper2St.setLong(1, artifactTypeID); getArtifactsHelper2St.setInt(1, artifactTypeID);
ResultSet rs = getArtifactsHelper2St.executeQuery(); ResultSet rs = getArtifactsHelper2St.executeQuery();
while (rs.next()) { while (rs.next()) {
...@@ -1823,14 +1823,14 @@ List<AbstractFile> getAbstractFileChildren(Content parent, TSK_DB_FILES_TYPE_ENU ...@@ -1823,14 +1823,14 @@ List<AbstractFile> getAbstractFileChildren(Content parent, TSK_DB_FILES_TYPE_ENU
try { try {
getAbstractFileChildren.setLong(1, parent.getId()); getAbstractFileChildren.setLong(1, parent.getId());
getAbstractFileChildren.setLong(2, type.getFileType()); getAbstractFileChildren.setShort(2, type.getFileType());
final ResultSet rs = getAbstractFileChildren.executeQuery(); final ResultSet rs = getAbstractFileChildren.executeQuery();
while (rs.next()) { while (rs.next()) {
if (type == TSK_DB_FILES_TYPE_ENUM.FS) { if (type == TSK_DB_FILES_TYPE_ENUM.FS) {
FsContent result; FsContent result;
if (rs.getLong("meta_type") == TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getMetaType()) { if (rs.getShort("meta_type") == TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getMetaType()) {
result = rsHelper.directory(rs, null); result = rsHelper.directory(rs, null);
} else { } else {
result = rsHelper.file(rs, null); result = rsHelper.file(rs, null);
...@@ -1863,7 +1863,7 @@ List<Long> getAbstractFileChildrenIds(Content parent, TSK_DB_FILES_TYPE_ENUM typ ...@@ -1863,7 +1863,7 @@ List<Long> getAbstractFileChildrenIds(Content parent, TSK_DB_FILES_TYPE_ENUM typ
try { try {
getAbstractFileChildrenIds.setLong(1, parent.getId()); getAbstractFileChildrenIds.setLong(1, parent.getId());
getAbstractFileChildrenIds.setLong(2, type.getFileType()); getAbstractFileChildrenIds.setShort(2, type.getFileType());
ResultSet rs = getAbstractFileChildrenIds.executeQuery(); ResultSet rs = getAbstractFileChildrenIds.executeQuery();
...@@ -2384,7 +2384,7 @@ Directory getDirectoryById(long id, FileSystem parentFs) throws TskCoreException ...@@ -2384,7 +2384,7 @@ Directory getDirectoryById(long id, FileSystem parentFs) throws TskCoreException
ResultSet rs = s.executeQuery("select * from tsk_files " ResultSet rs = s.executeQuery("select * from tsk_files "
+ "where obj_id = " + id); + "where obj_id = " + id);
if (rs.next() && rs.getLong("meta_type") == TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getMetaType()) { if (rs.next() && rs.getShort("meta_type") == TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getMetaType()) {
temp = rsHelper.directory(rs, parentFs); temp = rsHelper.directory(rs, parentFs);
} else { } else {
rs.close(); rs.close();
...@@ -2980,7 +2980,7 @@ public List<AbstractFile> resultSetToAbstractFiles(ResultSet rs) throws SQLExcep ...@@ -2980,7 +2980,7 @@ public List<AbstractFile> resultSetToAbstractFiles(ResultSet rs) throws SQLExcep
final short type = rs.getShort("type"); final short type = rs.getShort("type");
if (type == TSK_DB_FILES_TYPE_ENUM.FS.getFileType()) { if (type == TSK_DB_FILES_TYPE_ENUM.FS.getFileType()) {
FsContent result; FsContent result;
if (rs.getLong("meta_type") == TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getMetaType()) { if (rs.getShort("meta_type") == TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getMetaType()) {
result = rsHelper.directory(rs, null); result = rsHelper.directory(rs, null);
} else { } else {
result = rsHelper.file(rs, null); result = rsHelper.file(rs, null);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment