Skip to content
Snippets Groups Projects
Commit 8f8741da authored by Kelly Kelly's avatar Kelly Kelly
Browse files

Added support for LocalFilesDataSource in SleuthkitItemVisitor

parent 0a405478
No related branches found
No related tags found
No related merge requests found
/* /*
* Sleuth Kit Data Model * Sleuth Kit Data Model
* *
* Copyright 2011-2017 Basis Technology Corp. * Copyright 2011-2021 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -314,6 +314,34 @@ private static void closeStatement(Statement statement) { ...@@ -314,6 +314,34 @@ private static void closeStatement(Statement statement) {
} }
} }
/**
* Accepts a content visitor (Visitor design pattern).
*
* @param <T> The type returned by the visitor.
* @param visitor A ContentVisitor supplying an algorithm to run using this
* virtual directory as input.
*
* @return The output of the algorithm.
*/
@Override
public <T> T accept(ContentVisitor<T> visitor) {
return visitor.visit(this);
}
/**
* Accepts a Sleuthkit item visitor (Visitor design pattern).
*
* @param <T> The type returned by the visitor.
* @param visitor A SleuthkitItemVisitor supplying an algorithm to run using
* this virtual directory as input.
*
* @return The output of the algorithm.
*/
@Override
public <T> T accept(SleuthkitItemVisitor<T> visitor) {
return visitor.visit(this);
}
/** /**
* Constructs a local/logical files and/or directories data source. * Constructs a local/logical files and/or directories data source.
* *
......
/* /*
* Sleuth Kit Data Model * Sleuth Kit Data Model
* *
* Copyright 2011-2018 Basis Technology Corp. * Copyright 2011-2021 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -195,6 +195,15 @@ public interface SleuthkitItemVisitor<T> { ...@@ -195,6 +195,15 @@ public interface SleuthkitItemVisitor<T> {
* @return result of the visit * @return result of the visit
*/ */
T visit(UnsupportedContent unsupportedContent); T visit(UnsupportedContent unsupportedContent);
/**
* Act on (visit) a LocalFilesDataSource content object
*
* @param localFilesDataSource report to visit / act on
*
* @return result of the visit
*/
T visit(LocalFilesDataSource localFilesDataSource);
/** /**
* The default visitor - quickest method for implementing a custom visitor. * The default visitor - quickest method for implementing a custom visitor.
...@@ -298,5 +307,10 @@ public T visit(OsAccount account) { ...@@ -298,5 +307,10 @@ public T visit(OsAccount account) {
public T visit(UnsupportedContent unsupportedContent) { public T visit(UnsupportedContent unsupportedContent) {
return defaultVisit(unsupportedContent); return defaultVisit(unsupportedContent);
} }
@Override
public T visit(LocalFilesDataSource localFilesDataSource) {
return defaultVisit(localFilesDataSource);
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment