Autopsy  4.16.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  }
87 
88  PortableCaseReportModuleSettings(List<String> setNames, List<TagName> tagNames,
89  boolean compress, ChunkSize chunkSize, boolean allTagsSelected, boolean allSetsSelected) {
90  this.setNames.addAll(setNames);
91  this.tagNames.addAll(tagNames);
92  this.compress = compress;
93  this.chunkSize = chunkSize;
94  this.allTagsSelected = allTagsSelected;
95  this.allSetsSelected = allSetsSelected;
96  }
97 
98  @Override
99  public long getVersionNumber() {
100  return serialVersionUID;
101  }
102 
103  public void updateSetNames(List<String> setNames) {
104  this.setNames.clear();
105  this.setNames.addAll(setNames);
106  }
107 
108  public void updateTagNames(List<TagName> tagNames) {
109  this.tagNames.clear();
110  this.tagNames.addAll(tagNames);
111  }
112 
113  public void updateCompression(boolean compress, ChunkSize chunkSize) {
114  this.compress = compress;
115  this.chunkSize = chunkSize;
116  }
117 
118  public boolean isValid() {
119  return ((allTagsSelected || allSetsSelected || (!tagNames.isEmpty()) || (!setNames.isEmpty())));
120  }
121 
122  public List<String> getSelectedSetNames() {
123  return new ArrayList<>(setNames);
124  }
125 
126  public List<TagName> getSelectedTagNames() {
127  return new ArrayList<>(tagNames);
128  }
129 
130  public boolean shouldCompress() {
131  return compress;
132  }
133 
135  return chunkSize;
136  }
137 
138  public boolean areAllTagsSelected() {
139  return allTagsSelected;
140  }
141 
142  public boolean areAllSetsSelected() {
143  return allSetsSelected;
144  }
145 
146  public boolean includeApplication() {
148  }
149 
153  public void setAllTagsSelected(boolean allTagsSelected) {
154  this.allTagsSelected = allTagsSelected;
155  }
156 
160  public void setAllSetsSelected(boolean allSetsSelected) {
161  this.allSetsSelected = allSetsSelected;
162  }
163 
165  this.shouldIncludeApplication = includeApplication;
166  }
167 
168 }

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