mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
reduce API
This commit is contained in:
parent
0ec2af8619
commit
ab83c9940c
@ -847,35 +847,35 @@ public final class DrawableDB {
|
||||
*
|
||||
* @throws TskCoreException
|
||||
*/
|
||||
@Deprecated
|
||||
public long countFiles() throws TskCoreException {
|
||||
Statement statement = null;
|
||||
ResultSet rs = null;
|
||||
dbReadLock();
|
||||
try {
|
||||
statement = con.createStatement();
|
||||
rs = statement.executeQuery("SELECT COUNT (*) FROM drawable_files"); //NON-NLS
|
||||
return rs.getLong(1);
|
||||
} catch (SQLException e) {
|
||||
throw new TskCoreException("SQLException thrown when calling 'DrawableDB.countFiles(): ", e);
|
||||
} finally {
|
||||
if (rs != null) {
|
||||
try {
|
||||
rs.close();
|
||||
} catch (SQLException ex) {
|
||||
LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
if (statement != null) {
|
||||
try {
|
||||
statement.close();
|
||||
} catch (SQLException ex) {
|
||||
LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
dbReadUnlock();
|
||||
}
|
||||
}
|
||||
// @Deprecated
|
||||
// public long countFiles() throws TskCoreException {
|
||||
// Statement statement = null;
|
||||
// ResultSet rs = null;
|
||||
// dbReadLock();
|
||||
// try {
|
||||
// statement = con.createStatement();
|
||||
// rs = statement.executeQuery("SELECT COUNT (*) FROM drawable_files"); //NON-NLS
|
||||
// return rs.getLong(1);
|
||||
// } catch (SQLException e) {
|
||||
// throw new TskCoreException("SQLException thrown when calling 'DrawableDB.countFiles(): ", e);
|
||||
// } finally {
|
||||
// if (rs != null) {
|
||||
// try {
|
||||
// rs.close();
|
||||
// } catch (SQLException ex) {
|
||||
// LOGGER.log(Level.SEVERE, "Error closing result set after executing countFiles", ex); //NON-NLS
|
||||
// }
|
||||
// }
|
||||
// if (statement != null) {
|
||||
// try {
|
||||
// statement.close();
|
||||
// } catch (SQLException ex) {
|
||||
// LOGGER.log(Level.SEVERE, "Error closing statement after executing countFiles", ex); //NON-NLS
|
||||
// }
|
||||
// }
|
||||
// dbReadUnlock();
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
*
|
||||
@ -952,7 +952,12 @@ public final class DrawableDB {
|
||||
return vals;
|
||||
}
|
||||
|
||||
public void insertGroup(final String value, DrawableAttribute<?> groupBy) {
|
||||
/**
|
||||
* Insert new group into DB
|
||||
* @param value Value of the group (unique to the type)
|
||||
* @param groupBy Type of the grouping (CATEGORY, MAKE, etc.)
|
||||
*/
|
||||
private void insertGroup(final String value, DrawableAttribute<?> groupBy) {
|
||||
dbWriteLock();
|
||||
|
||||
try {
|
||||
@ -980,15 +985,15 @@ public final class DrawableDB {
|
||||
* @throws TskCoreException if unable to get a file from the currently open
|
||||
* {@link SleuthkitCase}
|
||||
*/
|
||||
private DrawableFile getFileFromID(Long id, boolean analyzed) throws TskCoreException {
|
||||
try {
|
||||
AbstractFile f = tskCase.getAbstractFileById(id);
|
||||
return DrawableFile.create(f, analyzed, isVideoFile(f));
|
||||
} catch (IllegalStateException ex) {
|
||||
LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); //NON-NLS
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// private DrawableFile getFileFromID(Long id, boolean analyzed) throws TskCoreException {
|
||||
// try {
|
||||
// AbstractFile f = tskCase.getAbstractFileById(id);
|
||||
// return DrawableFile.create(f, analyzed, isVideoFile(f));
|
||||
// } catch (IllegalStateException ex) {
|
||||
// LOGGER.log(Level.SEVERE, "there is no case open; failed to load file with id: " + id, ex); //NON-NLS
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* @param id the obj_id of the file to return
|
||||
|
Loading…
x
Reference in New Issue
Block a user