Autopsy  4.17.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
PortableCaseReportModuleSettings.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.report.modules.portablecase;
20 
22 import java.util.ArrayList;
23 import java.util.List;
24 import org.sleuthkit.datamodel.TagName;
25 
30 
31  private static final long serialVersionUID = 1L;
32 
33  private final List<TagName> tagNames = new ArrayList<>();
34  private final List<String> setNames = new ArrayList<>();
35  private boolean compress;
37  private boolean allTagsSelected;
38  private boolean allSetsSelected;
39  private boolean shouldIncludeApplication;
40 
45  public enum ChunkSize {
46 
47  NONE("Do not split", ""), // NON-NLS
48  ONE_HUNDRED_MB("Split into 100 MB chunks", "100m"),
49  CD("Split into 700 MB chunks (CD)", "700m"),
50  ONE_GB("Split into 1 GB chunks", "1000m"),
51  DVD("Split into 4.5 GB chunks (DVD)", "4500m"); // NON-NLS
52 
53  private final String displayName;
54  private final String sevenZipParam;
55 
62  private ChunkSize(String displayName, String sevenZipParam) {
63  this.displayName = displayName;
64  this.sevenZipParam = sevenZipParam;
65  }
66 
67  String getDisplayName() {
68  return displayName;
69  }
70 
71  String getSevenZipParam() {
72  return sevenZipParam;
73  }
74 
75  @Override
76  public String toString() {
77  return displayName;
78  }
79  }
80 
82  this.compress = false;
83  this.chunkSize = ChunkSize.NONE;
84  this.allTagsSelected = true;
85  this.allSetsSelected = true;
86  this.shouldIncludeApplication = false;
87  }
88 
89  PortableCaseReportModuleSettings(List<String> setNames, List<TagName> tagNames,
90  boolean compress, ChunkSize chunkSize, boolean allTagsSelected, boolean allSetsSelected) {
91  this.setNames.addAll(setNames);
92  this.tagNames.addAll(tagNames);
93  this.compress = compress;
94  this.chunkSize = chunkSize;
95  this.allTagsSelected = allTagsSelected;
96  this.allSetsSelected = allSetsSelected;
97  this.shouldIncludeApplication = false;
98  }
99 
100  @Override
101  public long getVersionNumber() {
102  return serialVersionUID;
103  }
104 
105  public void updateSetNames(List<String> setNames) {
106  this.setNames.clear();
107  this.setNames.addAll(setNames);
108  }
109 
110  public void updateTagNames(List<TagName> tagNames) {
111  this.tagNames.clear();
112  this.tagNames.addAll(tagNames);
113  }
114 
115  public void updateCompression(boolean compress, ChunkSize chunkSize) {
116  this.compress = compress;
117  this.chunkSize = chunkSize;
118  }
119 
120  public boolean isValid() {
121  return ((allTagsSelected || allSetsSelected || (!tagNames.isEmpty()) || (!setNames.isEmpty())));
122  }
123 
124  public List<String> getSelectedSetNames() {
125  return new ArrayList<>(setNames);
126  }
127 
128  public List<TagName> getSelectedTagNames() {
129  return new ArrayList<>(tagNames);
130  }
131 
132  public boolean shouldCompress() {
133  return compress;
134  }
135 
137  return chunkSize;
138  }
139 
140  public boolean areAllTagsSelected() {
141  return allTagsSelected;
142  }
143 
144  public boolean areAllSetsSelected() {
145  return allSetsSelected;
146  }
147 
148  public boolean includeApplication() {
150  }
151 
155  public void setAllTagsSelected(boolean allTagsSelected) {
156  this.allTagsSelected = allTagsSelected;
157  }
158 
162  public void setAllSetsSelected(boolean allSetsSelected) {
163  this.allSetsSelected = allSetsSelected;
164  }
165 
167  this.shouldIncludeApplication = includeApplication;
168  }
169 
170 }

Copyright © 2012-2021 Basis Technology. Generated on: Tue Jan 19 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.