Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
TypesSummaryGetter.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2019 - 2020 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.datasourcesummary.ui;
20 
22 import java.sql.SQLException;
23 import java.util.Arrays;
24 import java.util.Collections;
25 import java.util.HashSet;
26 import java.util.Set;
32 import org.sleuthkit.datamodel.AbstractFile;
33 import org.sleuthkit.datamodel.DataSource;
34 import org.sleuthkit.datamodel.TskCoreException;
35 
41 public class TypesSummaryGetter implements DefaultUpdateGovernor {
42 
43  private static final Set<IngestManager.IngestJobEvent> INGEST_JOB_EVENTS = new HashSet<>(
45 
46  private final TypesSummary typesSummary;
47 
51  public TypesSummaryGetter() {
52  typesSummary = new TypesSummary();
53  }
54 
55  @Override
56  public boolean isRefreshRequired(ModuleContentEvent evt) {
57  return true;
58  }
59 
60  @Override
61  public boolean isRefreshRequired(AbstractFile file) {
62  return true;
63  }
64 
65  @Override
67  return (evt != null && INGEST_JOB_EVENTS.contains(evt));
68  }
69 
70  @Override
72  return Collections.unmodifiableSet(INGEST_JOB_EVENTS);
73  }
74 
86  public Long getCountOfFiles(DataSource currentDataSource)
87  throws SleuthkitCaseProvider.SleuthkitCaseProviderException, TskCoreException, SQLException {
88  return typesSummary.getCountOfFiles(currentDataSource);
89  }
90 
102  public Long getCountOfAllocatedFiles(DataSource currentDataSource)
103  throws SleuthkitCaseProvider.SleuthkitCaseProviderException, TskCoreException, SQLException {
104  return typesSummary.getCountOfAllocatedFiles(currentDataSource);
105  }
106 
118  public Long getCountOfUnallocatedFiles(DataSource currentDataSource)
119  throws SleuthkitCaseProvider.SleuthkitCaseProviderException, TskCoreException, SQLException {
120  return typesSummary.getCountOfUnallocatedFiles(currentDataSource);
121  }
122 
134  public Long getCountOfDirectories(DataSource currentDataSource)
135  throws SleuthkitCaseProvider.SleuthkitCaseProviderException, TskCoreException, SQLException {
136  return typesSummary.getCountOfDirectories(currentDataSource);
137  }
138 
150  public Long getCountOfSlackFiles(DataSource currentDataSource)
151  throws SleuthkitCaseProvider.SleuthkitCaseProviderException, TskCoreException, SQLException {
152  return typesSummary.getCountOfSlackFiles(currentDataSource);
153  }
154 }
boolean isRefreshRequired(IngestManager.IngestJobEvent evt)
static final Set< IngestManager.IngestJobEvent > INGEST_JOB_EVENTS

Copyright © 2012-2022 Basis Technology. Generated on: Thu Oct 6 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.