Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
3bc97453
Unverified
Commit
3bc97453
authored
2 years ago
by
eugene7646
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2836 from gdicristofaro/7121-openFiles
7121 open files
parents
393247bc
f9f76648
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java
+32
-16
32 additions, 16 deletions
bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java
with
32 additions
and
16 deletions
bindings/java/src/org/sleuthkit/datamodel/SleuthkitCase.java
+
32
−
16
View file @
3bc97453
...
@@ -10066,34 +10066,50 @@ public List<Image> getImages() throws TskCoreException {
...
@@ -10066,34 +10066,50 @@ public List<Image> getImages() throws TskCoreException {
* within tsk core and the update fails
* within tsk core and the update fails
*/
*/
public void setImagePaths(long obj_id, List<String> paths) throws TskCoreException {
public void setImagePaths(long obj_id, List<String> paths) throws TskCoreException {
CaseDbConnection connection = null;
CaseDbTransaction transaction = beginTransaction();
acquireSingleUserCaseWriteLock();
PreparedStatement statement;
try {
try {
connection = connections.getConnection();
setImagePaths(obj_id, paths, transaction);
connection.beginTransaction();
transaction.commit();
statement = connection.getPreparedStatement(PREPARED_STATEMENT.DELETE_IMAGE_NAME);
transaction = null;
} finally {
if (transaction != null) {
transaction.rollback();
}
}
}
/**
* Set the file paths for the image given by obj_id
*
* @param obj_id the ID of the image to update
* @param paths the fully qualified path to the files that make up the
* image
* @param trans The case database transaction.
*
* @throws TskCoreException exception thrown when critical error occurs
* within tsk core and the update fails
*/
@Beta
public void setImagePaths(long obj_id, List<String> paths, CaseDbTransaction trans) throws TskCoreException {
try {
PreparedStatement statement = trans.getConnection().getPreparedStatement(PREPARED_STATEMENT.DELETE_IMAGE_NAME);
statement.clearParameters();
statement.clearParameters();
statement.setLong(1, obj_id);
statement.setLong(1, obj_id);
c
onnection.executeUpdate(statement);
trans.getC
onnection
()
.executeUpdate(statement);
for (int i = 0; i < paths.size(); i++) {
for (int i = 0; i < paths.size(); i++) {
statement =
c
onnection.getPreparedStatement(PREPARED_STATEMENT.INSERT_IMAGE_NAME);
statement =
trans.getC
onnection
()
.getPreparedStatement(PREPARED_STATEMENT.INSERT_IMAGE_NAME);
statement.clearParameters();
statement.clearParameters();
statement.setLong(1, obj_id);
statement.setLong(1, obj_id);
statement.setString(2, paths.get(i));
statement.setString(2, paths.get(i));
statement.setLong(3, i);
statement.setLong(3, i);
c
onnection.executeUpdate(statement);
trans.getC
onnection
()
.executeUpdate(statement);
}
}
connection.commitTransaction();
} catch (SQLException ex) {
} catch (SQLException ex) {
rollbackTransaction(connection);
throw new TskCoreException("Error updating image paths.", ex);
throw new TskCoreException("Error updating image paths.", ex);
} finally {
}
closeConnection(connection);
releaseSingleUserCaseWriteLock();
}
}
}
/**
/**
* Deletes a datasource from the open case, the database has foreign keys
* Deletes a datasource from the open case, the database has foreign keys
* with a delete cascade so that all the tables that have a datasource
* with a delete cascade so that all the tables that have a datasource
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment