Autopsy  4.14.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 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 
44  public enum ChunkSize {
45 
46  NONE("Do not split", ""), // NON-NLS
47  ONE_HUNDRED_MB("Split into 100 MB chunks", "100m"),
48  CD("Split into 700 MB chunks (CD)", "700m"),
49  ONE_GB("Split into 1 GB chunks", "1000m"),
50  DVD("Split into 4.5 GB chunks (DVD)", "4500m"); // NON-NLS
51 
52  private final String displayName;
53  private final String sevenZipParam;
54 
61  private ChunkSize(String displayName, String sevenZipParam) {
62  this.displayName = displayName;
63  this.sevenZipParam = sevenZipParam;
64  }
65 
66  String getDisplayName() {
67  return displayName;
68  }
69 
70  String getSevenZipParam() {
71  return sevenZipParam;
72  }
73 
74  @Override
75  public String toString() {
76  return displayName;
77  }
78  }
79 
81  this.compress = false;
82  this.chunkSize = ChunkSize.NONE;
83  this.allTagsSelected = true;
84  this.allSetsSelected = true;
85  }
86 
87  PortableCaseReportModuleSettings(List<String> setNames, List<TagName> tagNames,
88  boolean compress, ChunkSize chunkSize, boolean allTagsSelected, boolean allSetsSelected) {
89  this.setNames.addAll(setNames);
90  this.tagNames.addAll(tagNames);
91  this.compress = compress;
92  this.chunkSize = chunkSize;
93  this.allTagsSelected = allTagsSelected;
94  this.allSetsSelected = allSetsSelected;
95  }
96 
97  @Override
98  public long getVersionNumber() {
99  return serialVersionUID;
100  }
101 
102  public void updateSetNames(List<String> setNames) {
103  this.setNames.clear();
104  this.setNames.addAll(setNames);
105  }
106 
107  public void updateTagNames(List<TagName> tagNames) {
108  this.tagNames.clear();
109  this.tagNames.addAll(tagNames);
110  }
111 
112  public void updateCompression(boolean compress, ChunkSize chunkSize) {
113  this.compress = compress;
114  this.chunkSize = chunkSize;
115  }
116 
117  public boolean isValid() {
118  return ((allTagsSelected || allSetsSelected || (!tagNames.isEmpty()) || (!setNames.isEmpty())));
119  }
120 
121  public List<String> getSelectedSetNames() {
122  return new ArrayList<>(setNames);
123  }
124 
125  public List<TagName> getSelectedTagNames() {
126  return new ArrayList<>(tagNames);
127  }
128 
129  public boolean shouldCompress() {
130  return compress;
131  }
132 
134  return chunkSize;
135  }
136 
137  public boolean areAllTagsSelected() {
138  return allTagsSelected;
139  }
140 
141  public boolean areAllSetsSelected() {
142  return allSetsSelected;
143  }
144 
148  public void setAllTagsSelected(boolean allTagsSelected) {
149  this.allTagsSelected = allTagsSelected;
150  }
151 
155  public void setAllSetsSelected(boolean allSetsSelected) {
156  this.allSetsSelected = allSetsSelected;
157  }
158 
159 }

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