Autopsy  4.21.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
FileSystemDetailsPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2018 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.directorytree;
20 
21 import java.awt.event.ActionListener;
22 import java.util.logging.Level;
24 import org.sleuthkit.datamodel.FileSystem;
25 import org.sleuthkit.datamodel.Volume;
26 import org.sleuthkit.datamodel.TskCoreException;
27 
31 @SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
32 final class FileSystemDetailsPanel extends javax.swing.JPanel {
33  private static final Logger logger = Logger.getLogger(FileSystemDetailsPanel.class.getName());
34  private static final long serialVersionUID = 1L;
35 
39  FileSystemDetailsPanel() {
40  initComponents();
41  }
42 
43  FileSystemDetailsPanel(Volume content) {
44  initComponents();
45  try {
46  FileSystem fSystem = content.getFileSystems().get(0); //Autopsy currently only supports one file system per Volume
47  setFileSystemTypeValue(fSystem.getFsType().getDisplayName());
48  setImageOffsetValue(Long.toString(fSystem.getImageOffset()));
49  setVolumeIDValue(Long.toString(fSystem.getId()));
50  setBlockSizeValue(Long.toString(fSystem.getBlock_size()));
51  setBlockCountValue(Long.toString(fSystem.getBlock_count()));
52  setRootInumValue(Long.toString(fSystem.getRoot_inum()));
53  setFirstInumValue(Long.toString(fSystem.getFirst_inum()));
54  setLastInumValue(Long.toString(fSystem.getLastInum()));
55  } catch (TskCoreException|ArrayIndexOutOfBoundsException ex) {
56  logger.log(Level.SEVERE, "Unable to construct FileSystemDetailsPanel",ex);
57  }
58 
59  }
60 
66  @SuppressWarnings("unchecked")
67  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
68  private void initComponents() {
69 
70  OKButton = new javax.swing.JButton();
71  genInfoPanel = new javax.swing.JPanel();
72  fsTypeLabel = new javax.swing.JLabel();
73  imgOffsetLabel = new javax.swing.JLabel();
74  volumeIDLabel = new javax.swing.JLabel();
75  blockSizeLabel = new javax.swing.JLabel();
76  blockCountLabel = new javax.swing.JLabel();
77  rootInumLabel = new javax.swing.JLabel();
78  firstInumLabel = new javax.swing.JLabel();
79  lastInumLabel = new javax.swing.JLabel();
80  fsTypeValue = new javax.swing.JLabel();
81  imgOffsetValue = new javax.swing.JLabel();
82  volumeIDValue = new javax.swing.JLabel();
83  blockSizeValue = new javax.swing.JLabel();
84  blockCountValue = new javax.swing.JLabel();
85  rootInumValue = new javax.swing.JLabel();
86  firstInumValue = new javax.swing.JLabel();
87  lastInumValue = new javax.swing.JLabel();
88  jSeparator1 = new javax.swing.JSeparator();
89  bytesLabel1 = new javax.swing.JLabel();
90  bytesLabel2 = new javax.swing.JLabel();
91 
92  OKButton.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.OKButton.text")); // NOI18N
93 
94  genInfoPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
95  genInfoPanel.setPreferredSize(new java.awt.Dimension(815, 170));
96 
97  fsTypeLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.fsTypeLabel.text")); // NOI18N
98 
99  imgOffsetLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.imgOffsetLabel.text")); // NOI18N
100 
101  volumeIDLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.volumeIDLabel.text")); // NOI18N
102 
103  blockSizeLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.blockSizeLabel.text")); // NOI18N
104 
105  blockCountLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.blockCountLabel.text")); // NOI18N
106 
107  rootInumLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.rootInumLabel.text")); // NOI18N
108 
109  firstInumLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.firstInumLabel.text")); // NOI18N
110 
111  lastInumLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.lastInumLabel.text")); // NOI18N
112 
113  fsTypeValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.fsTypeValue.text")); // NOI18N
114 
115  imgOffsetValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.imgOffsetValue.text")); // NOI18N
116 
117  volumeIDValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.volumeIDValue.text")); // NOI18N
118 
119  blockSizeValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.blockSizeValue.text")); // NOI18N
120 
121  blockCountValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.blockCountValue.text")); // NOI18N
122 
123  rootInumValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.rootInumValue.text")); // NOI18N
124 
125  firstInumValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.firstInumValue.text")); // NOI18N
126 
127  lastInumValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.lastInumValue.text")); // NOI18N
128 
129  jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
130 
131  bytesLabel1.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.bytesLabel1.text")); // NOI18N
132 
133  bytesLabel2.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.bytesLabel2.text")); // NOI18N
134 
135  javax.swing.GroupLayout genInfoPanelLayout = new javax.swing.GroupLayout(genInfoPanel);
136  genInfoPanel.setLayout(genInfoPanelLayout);
137  genInfoPanelLayout.setHorizontalGroup(
138  genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
139  .addGroup(genInfoPanelLayout.createSequentialGroup()
140  .addGap(10, 10, 10)
141  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
142  .addComponent(fsTypeLabel)
143  .addComponent(imgOffsetLabel)
144  .addComponent(volumeIDLabel)
145  .addComponent(blockSizeLabel))
146  .addGap(10, 10, 10)
147  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
148  .addGroup(genInfoPanelLayout.createSequentialGroup()
149  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
150  .addComponent(blockSizeValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
151  .addComponent(imgOffsetValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
152  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
153  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
154  .addComponent(bytesLabel1)
155  .addComponent(bytesLabel2)))
156  .addComponent(volumeIDValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
157  .addComponent(fsTypeValue))
158  .addGap(10, 10, 10)
159  .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
160  .addGap(10, 10, 10)
161  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
162  .addComponent(blockCountLabel)
163  .addComponent(rootInumLabel)
164  .addComponent(firstInumLabel)
165  .addComponent(lastInumLabel))
166  .addGap(10, 10, 10)
167  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
168  .addComponent(blockCountValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
169  .addComponent(rootInumValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
170  .addComponent(firstInumValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
171  .addComponent(lastInumValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
172  .addContainerGap(226, Short.MAX_VALUE))
173  );
174  genInfoPanelLayout.setVerticalGroup(
175  genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
176  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, genInfoPanelLayout.createSequentialGroup()
177  .addGap(10, 10, 10)
178  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
179  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
180  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
181  .addGroup(genInfoPanelLayout.createSequentialGroup()
182  .addComponent(fsTypeLabel)
183  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
184  .addComponent(imgOffsetLabel)
185  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
186  .addComponent(volumeIDLabel)
187  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
188  .addComponent(blockSizeLabel))
189  .addGroup(genInfoPanelLayout.createSequentialGroup()
190  .addComponent(fsTypeValue)
191  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
192  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
193  .addComponent(imgOffsetValue)
194  .addComponent(bytesLabel1))
195  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
196  .addComponent(volumeIDValue)
197  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
198  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
199  .addComponent(blockSizeValue)
200  .addComponent(bytesLabel2))))
201  .addGroup(genInfoPanelLayout.createSequentialGroup()
202  .addComponent(blockCountValue)
203  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
204  .addComponent(rootInumValue)
205  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
206  .addComponent(firstInumValue)
207  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
208  .addComponent(lastInumValue))
209  .addGroup(genInfoPanelLayout.createSequentialGroup()
210  .addComponent(blockCountLabel)
211  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
212  .addComponent(rootInumLabel)
213  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
214  .addComponent(firstInumLabel)
215  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
216  .addComponent(lastInumLabel)))
217  .addComponent(jSeparator1))
218  .addContainerGap())
219  );
220 
221  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
222  this.setLayout(layout);
223  layout.setHorizontalGroup(
224  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
225  .addGroup(layout.createSequentialGroup()
226  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
227  .addGroup(layout.createSequentialGroup()
228  .addContainerGap()
229  .addComponent(genInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 534, javax.swing.GroupLayout.PREFERRED_SIZE))
230  .addGroup(layout.createSequentialGroup()
231  .addGap(221, 221, 221)
232  .addComponent(OKButton)))
233  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
234  );
235  layout.setVerticalGroup(
236  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
237  .addGroup(layout.createSequentialGroup()
238  .addContainerGap()
239  .addComponent(genInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
240  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
241  .addComponent(OKButton)
242  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
243  );
244  }// </editor-fold>//GEN-END:initComponents
245 
251  public void setFileSystemTypeValue(String arg) {
252  fsTypeValue.setText(arg);
253  }
254 
260  public void setImageOffsetValue(String arg) {
261  imgOffsetValue.setText(arg);
262  }
263 
269  public void setVolumeIDValue(String arg) {
270  volumeIDValue.setText(arg);
271  }
272 
278  public void setBlockSizeValue(String arg) {
279  blockSizeValue.setText(arg);
280  }
281 
287  public void setBlockCountValue(String arg) {
288  blockCountValue.setText(arg);
289  }
290 
296  public void setRootInumValue(String arg) {
297  rootInumValue.setText(arg);
298  }
299 
305  public void setFirstInumValue(String arg) {
306  firstInumValue.setText(arg);
307  }
308 
314  public void setLastInumValue(String arg) {
315  lastInumValue.setText(arg);
316  }
317 
323  public void setOKButtonActionListener(ActionListener e) {
324  OKButton.addActionListener(e);
325  }
326  // Variables declaration - do not modify//GEN-BEGIN:variables
327  private javax.swing.JButton OKButton;
328  private javax.swing.JLabel blockCountLabel;
329  private javax.swing.JLabel blockCountValue;
330  private javax.swing.JLabel blockSizeLabel;
331  private javax.swing.JLabel blockSizeValue;
332  private javax.swing.JLabel bytesLabel1;
333  private javax.swing.JLabel bytesLabel2;
334  private javax.swing.JLabel firstInumLabel;
335  private javax.swing.JLabel firstInumValue;
336  private javax.swing.JLabel fsTypeLabel;
337  private javax.swing.JLabel fsTypeValue;
338  private javax.swing.JPanel genInfoPanel;
339  private javax.swing.JLabel imgOffsetLabel;
340  private javax.swing.JLabel imgOffsetValue;
341  private javax.swing.JSeparator jSeparator1;
342  private javax.swing.JLabel lastInumLabel;
343  private javax.swing.JLabel lastInumValue;
344  private javax.swing.JLabel rootInumLabel;
345  private javax.swing.JLabel rootInumValue;
346  private javax.swing.JLabel volumeIDLabel;
347  private javax.swing.JLabel volumeIDValue;
348  // End of variables declaration//GEN-END:variables
349 }

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