Autopsy  4.12.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  jLabel2 = new javax.swing.JLabel();
90  jLabel3 = 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.setFont(fsTypeLabel.getFont().deriveFont(fsTypeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
98  fsTypeLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.fsTypeLabel.text")); // NOI18N
99 
100  imgOffsetLabel.setFont(imgOffsetLabel.getFont().deriveFont(imgOffsetLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
101  imgOffsetLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.imgOffsetLabel.text")); // NOI18N
102 
103  volumeIDLabel.setFont(volumeIDLabel.getFont().deriveFont(volumeIDLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
104  volumeIDLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.volumeIDLabel.text")); // NOI18N
105 
106  blockSizeLabel.setFont(blockSizeLabel.getFont().deriveFont(blockSizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
107  blockSizeLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.blockSizeLabel.text")); // NOI18N
108 
109  blockCountLabel.setFont(blockCountLabel.getFont().deriveFont(blockCountLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
110  blockCountLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.blockCountLabel.text")); // NOI18N
111 
112  rootInumLabel.setFont(rootInumLabel.getFont().deriveFont(rootInumLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
113  rootInumLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.rootInumLabel.text")); // NOI18N
114 
115  firstInumLabel.setFont(firstInumLabel.getFont().deriveFont(firstInumLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
116  firstInumLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.firstInumLabel.text")); // NOI18N
117 
118  lastInumLabel.setFont(lastInumLabel.getFont().deriveFont(lastInumLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
119  lastInumLabel.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.lastInumLabel.text")); // NOI18N
120 
121  fsTypeValue.setFont(fsTypeValue.getFont().deriveFont(fsTypeValue.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
122  fsTypeValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.fsTypeValue.text")); // NOI18N
123 
124  imgOffsetValue.setFont(imgOffsetValue.getFont().deriveFont(imgOffsetValue.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
125  imgOffsetValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.imgOffsetValue.text")); // NOI18N
126 
127  volumeIDValue.setFont(volumeIDValue.getFont().deriveFont(volumeIDValue.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
128  volumeIDValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.volumeIDValue.text")); // NOI18N
129 
130  blockSizeValue.setFont(blockSizeValue.getFont().deriveFont(blockSizeValue.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
131  blockSizeValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.blockSizeValue.text")); // NOI18N
132 
133  blockCountValue.setFont(blockCountValue.getFont().deriveFont(blockCountValue.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
134  blockCountValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.blockCountValue.text")); // NOI18N
135 
136  rootInumValue.setFont(rootInumValue.getFont().deriveFont(rootInumValue.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
137  rootInumValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.rootInumValue.text")); // NOI18N
138 
139  firstInumValue.setFont(firstInumValue.getFont().deriveFont(firstInumValue.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
140  firstInumValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.firstInumValue.text")); // NOI18N
141 
142  lastInumValue.setFont(lastInumValue.getFont().deriveFont(lastInumValue.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
143  lastInumValue.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.lastInumValue.text")); // NOI18N
144 
145  jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
146 
147  jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
148  jLabel2.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.jLabel2.text")); // NOI18N
149 
150  jLabel3.setFont(jLabel3.getFont().deriveFont(jLabel3.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
151  jLabel3.setText(org.openide.util.NbBundle.getMessage(FileSystemDetailsPanel.class, "FileSystemDetailsPanel.jLabel3.text")); // NOI18N
152 
153  javax.swing.GroupLayout genInfoPanelLayout = new javax.swing.GroupLayout(genInfoPanel);
154  genInfoPanel.setLayout(genInfoPanelLayout);
155  genInfoPanelLayout.setHorizontalGroup(
156  genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
157  .addGroup(genInfoPanelLayout.createSequentialGroup()
158  .addGap(10, 10, 10)
159  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
160  .addComponent(fsTypeLabel)
161  .addComponent(imgOffsetLabel)
162  .addComponent(volumeIDLabel)
163  .addComponent(blockSizeLabel))
164  .addGap(10, 10, 10)
165  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
166  .addGroup(genInfoPanelLayout.createSequentialGroup()
167  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
168  .addComponent(blockSizeValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
169  .addComponent(imgOffsetValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
170  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
171  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
172  .addComponent(jLabel2)
173  .addComponent(jLabel3)))
174  .addComponent(volumeIDValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
175  .addComponent(fsTypeValue))
176  .addGap(10, 10, 10)
177  .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
178  .addGap(10, 10, 10)
179  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
180  .addComponent(blockCountLabel)
181  .addComponent(rootInumLabel)
182  .addComponent(firstInumLabel)
183  .addComponent(lastInumLabel))
184  .addGap(10, 10, 10)
185  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
186  .addComponent(blockCountValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
187  .addComponent(rootInumValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
188  .addComponent(firstInumValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
189  .addComponent(lastInumValue, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
190  .addContainerGap(229, Short.MAX_VALUE))
191  );
192  genInfoPanelLayout.setVerticalGroup(
193  genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
194  .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, genInfoPanelLayout.createSequentialGroup()
195  .addGap(10, 10, 10)
196  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
197  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
198  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
199  .addGroup(genInfoPanelLayout.createSequentialGroup()
200  .addComponent(fsTypeLabel)
201  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
202  .addComponent(imgOffsetLabel)
203  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
204  .addComponent(volumeIDLabel)
205  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
206  .addComponent(blockSizeLabel))
207  .addGroup(genInfoPanelLayout.createSequentialGroup()
208  .addComponent(fsTypeValue)
209  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
210  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
211  .addComponent(imgOffsetValue)
212  .addComponent(jLabel2))
213  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
214  .addComponent(volumeIDValue)
215  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
216  .addGroup(genInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
217  .addComponent(blockSizeValue)
218  .addComponent(jLabel3))))
219  .addGroup(genInfoPanelLayout.createSequentialGroup()
220  .addComponent(blockCountValue)
221  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
222  .addComponent(rootInumValue)
223  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
224  .addComponent(firstInumValue)
225  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
226  .addComponent(lastInumValue))
227  .addGroup(genInfoPanelLayout.createSequentialGroup()
228  .addComponent(blockCountLabel)
229  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
230  .addComponent(rootInumLabel)
231  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
232  .addComponent(firstInumLabel)
233  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
234  .addComponent(lastInumLabel)))
235  .addComponent(jSeparator1))
236  .addContainerGap())
237  );
238 
239  javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
240  this.setLayout(layout);
241  layout.setHorizontalGroup(
242  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
243  .addGroup(layout.createSequentialGroup()
244  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
245  .addGroup(layout.createSequentialGroup()
246  .addContainerGap()
247  .addComponent(genInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 534, javax.swing.GroupLayout.PREFERRED_SIZE))
248  .addGroup(layout.createSequentialGroup()
249  .addGap(221, 221, 221)
250  .addComponent(OKButton)))
251  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
252  );
253  layout.setVerticalGroup(
254  layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
255  .addGroup(layout.createSequentialGroup()
256  .addContainerGap()
257  .addComponent(genInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
258  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
259  .addComponent(OKButton)
260  .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
261  );
262  }// </editor-fold>//GEN-END:initComponents
263 
269  public void setFileSystemTypeValue(String arg) {
270  fsTypeValue.setText(arg);
271  }
272 
278  public void setImageOffsetValue(String arg) {
279  imgOffsetValue.setText(arg);
280  }
281 
287  public void setVolumeIDValue(String arg) {
288  volumeIDValue.setText(arg);
289  }
290 
296  public void setBlockSizeValue(String arg) {
297  blockSizeValue.setText(arg);
298  }
299 
305  public void setBlockCountValue(String arg) {
306  blockCountValue.setText(arg);
307  }
308 
314  public void setRootInumValue(String arg) {
315  rootInumValue.setText(arg);
316  }
317 
323  public void setFirstInumValue(String arg) {
324  firstInumValue.setText(arg);
325  }
326 
332  public void setLastInumValue(String arg) {
333  lastInumValue.setText(arg);
334  }
335 
341  public void setOKButtonActionListener(ActionListener e) {
342  OKButton.addActionListener(e);
343  }
344  // Variables declaration - do not modify//GEN-BEGIN:variables
345  private javax.swing.JButton OKButton;
346  private javax.swing.JLabel blockCountLabel;
347  private javax.swing.JLabel blockCountValue;
348  private javax.swing.JLabel blockSizeLabel;
349  private javax.swing.JLabel blockSizeValue;
350  private javax.swing.JLabel firstInumLabel;
351  private javax.swing.JLabel firstInumValue;
352  private javax.swing.JLabel fsTypeLabel;
353  private javax.swing.JLabel fsTypeValue;
354  private javax.swing.JPanel genInfoPanel;
355  private javax.swing.JLabel imgOffsetLabel;
356  private javax.swing.JLabel imgOffsetValue;
357  private javax.swing.JLabel jLabel2;
358  private javax.swing.JLabel jLabel3;
359  private javax.swing.JSeparator jSeparator1;
360  private javax.swing.JLabel lastInumLabel;
361  private javax.swing.JLabel lastInumValue;
362  private javax.swing.JLabel rootInumLabel;
363  private javax.swing.JLabel rootInumValue;
364  private javax.swing.JLabel volumeIDLabel;
365  private javax.swing.JLabel volumeIDValue;
366  // End of variables declaration//GEN-END:variables
367 }

Copyright © 2012-2018 Basis Technology. Generated on: Wed Sep 18 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.