diff --git a/bindings/java/src/org/sleuthkit/datamodel/LocalFilesDataSource.java b/bindings/java/src/org/sleuthkit/datamodel/LocalFilesDataSource.java index fbf5449a8c61b52be375fffc28166219b9c02136..ae5652c88eb550555c887a69db33822a162f9b3a 100755 --- a/bindings/java/src/org/sleuthkit/datamodel/LocalFilesDataSource.java +++ b/bindings/java/src/org/sleuthkit/datamodel/LocalFilesDataSource.java @@ -1,7 +1,7 @@ /* * Sleuth Kit Data Model * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2021 Basis Technology Corp. * Contact: carrier <at> sleuthkit <dot> org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -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. * diff --git a/bindings/java/src/org/sleuthkit/datamodel/SleuthkitItemVisitor.java b/bindings/java/src/org/sleuthkit/datamodel/SleuthkitItemVisitor.java index 45927b1093bc598518bd573fbaa44d9eed4f6596..5e90113f99b0647e451fb2d5cef4c80cca79a0b2 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/SleuthkitItemVisitor.java +++ b/bindings/java/src/org/sleuthkit/datamodel/SleuthkitItemVisitor.java @@ -1,7 +1,7 @@ /* * Sleuth Kit Data Model * - * Copyright 2011-2018 Basis Technology Corp. + * Copyright 2011-2021 Basis Technology Corp. * Contact: carrier <at> sleuthkit <dot> org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -195,6 +195,15 @@ public interface SleuthkitItemVisitor<T> { * @return result of the visit */ 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. @@ -298,5 +307,10 @@ public T visit(OsAccount account) { public T visit(UnsupportedContent unsupportedContent) { return defaultVisit(unsupportedContent); } + + @Override + public T visit(LocalFilesDataSource localFilesDataSource) { + return defaultVisit(localFilesDataSource); + } } }