change variable names

This commit is contained in:
momo 2015-10-28 15:11:46 -04:00
parent 39bf598ca9
commit 796e441765
4 changed files with 29 additions and 26 deletions

View File

@ -46,4 +46,4 @@ FileTypeIdGlobalSettingsPanel.jLabel2.text=MIME Types:
FileTypeIdGlobalSettingsPanel.jLabel3.text=Autopsy can automatically detect many file types. Add your custom file types here.
FileTypeIdGlobalSettingsPanel.startUp.fileTypeDetectorInitializationException.msg=Error initializing the file type detector.
FileTypeIdIngestModule.startUp.fileTypeDetectorInitializationException.msg=Error initializing the file type detector.
FileTypeIdGlobalSettingsPanel.isFooterCheckBox.text=This signature is a footer
FileTypeIdGlobalSettingsPanel.isTrailingCheckBox.text=This signature is a trailing

View File

@ -203,13 +203,14 @@ class FileType {
* @param signatureBytes The signature bytes.
* @param offset The offset of the signature bytes.
* @param type The type of data in the byte array. Impacts
* how it is displayed to the user in the UI.
* how it is displayed to the user in the UI.
* @param trailing Determines whether this signature is trailing.
*/
Signature(final byte[] signatureBytes, long offset, Type type, boolean isFooter) {
Signature(final byte[] signatureBytes, long offset, Type type, boolean trailing) {
this.signatureBytes = Arrays.copyOf(signatureBytes, signatureBytes.length);
this.offset = offset;
this.type = type;
this.trailing = isFooter;
this.trailing = trailing;
}
/**
@ -218,12 +219,13 @@ class FileType {
*
* @param signatureString The ASCII string
* @param offset The offset of the signature bytes.
* @param trailing Determines whether this signature is trailing.
*/
Signature(String signatureString, long offset, boolean isFooter) {
Signature(String signatureString, long offset, boolean trailing) {
this.signatureBytes = signatureString.getBytes(StandardCharsets.US_ASCII);
this.offset = offset;
this.type = Type.ASCII;
this.trailing = isFooter;
this.trailing = trailing;
}
/**
@ -234,12 +236,13 @@ class FileType {
*
* @param signatureBytes The signature bytes.
* @param offset The offset of the signature bytes.
* @param trailing Determines whether this signature is trailing.
*/
Signature(final byte[] signatureBytes, long offset, boolean isFooter) {
Signature(final byte[] signatureBytes, long offset, boolean trailing) {
this.signatureBytes = Arrays.copyOf(signatureBytes, signatureBytes.length);
this.offset = offset;
this.type = Type.RAW;
this.trailing = isFooter;
this.trailing = trailing;
}
/**

View File

@ -83,7 +83,7 @@
<Component id="saveTypeButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
</Group>
<Component id="isFooterCheckBox" min="-2" max="-2" attributes="0"/>
<Component id="isTrailingCheckBox" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
@ -140,7 +140,7 @@
<Component id="signatureLabel" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="isFooterCheckBox" min="-2" max="-2" attributes="0"/>
<Component id="isTrailingCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="offsetTextField" alignment="3" min="-2" max="-2" attributes="0"/>
@ -353,14 +353,14 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="isFooterCheckBox">
<Component class="javax.swing.JCheckBox" name="isTrailingCheckBox">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/modules/filetypeid/Bundle.properties" key="FileTypeIdGlobalSettingsPanel.isFooterCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<ResourceString bundle="org/sleuthkit/autopsy/modules/filetypeid/Bundle.properties" key="FileTypeIdGlobalSettingsPanel.isTrailingCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="isFooterCheckBoxActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="isTrailingCheckBoxActionPerformed"/>
</Events>
</Component>
</SubComponents>

View File

@ -270,7 +270,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
}
}
signatureTextField.setText(signatureBytes);
isFooterCheckBox.setSelected(signature.isTrailing());
isTrailingCheckBox.setSelected(signature.isTrailing());
offsetTextField.setText(Long.toString(signature.getOffset()));
postHitCheckBox.setSelected(fileType.alertOnMatch());
filesSetNameTextField.setEnabled(postHitCheckBox.isSelected());
@ -290,7 +290,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
signatureTypeComboBox.setSelectedItem(FileTypeIdGlobalSettingsPanel.RAW_SIGNATURE_TYPE_COMBO_BOX_ITEM);
hexPrefixLabel.setVisible(true);
signatureTextField.setText("0000"); //NON-NLS
isFooterCheckBox.setSelected(false);
isTrailingCheckBox.setSelected(false);
offsetTextField.setText(""); //NON-NLS
postHitCheckBox.setSelected(false);
filesSetNameTextField.setText(""); //NON-NLS
@ -362,7 +362,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
isFooterCheckBox = new javax.swing.JCheckBox();
isTrailingCheckBox = new javax.swing.JCheckBox();
setMaximumSize(new java.awt.Dimension(500, 300));
setPreferredSize(new java.awt.Dimension(500, 300));
@ -442,10 +442,10 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.jLabel3.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(isFooterCheckBox, org.openide.util.NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.isFooterCheckBox.text")); // NOI18N
isFooterCheckBox.addActionListener(new java.awt.event.ActionListener() {
org.openide.awt.Mnemonics.setLocalizedText(isTrailingCheckBox, org.openide.util.NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.isTrailingCheckBox.text")); // NOI18N
isTrailingCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
isFooterCheckBoxActionPerformed(evt);
isTrailingCheckBoxActionPerformed(evt);
}
});
@ -502,7 +502,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(saveTypeButton)
.addGap(8, 8, 8))
.addComponent(isFooterCheckBox)))
.addComponent(isTrailingCheckBox)))
.addComponent(jLabel1)
.addComponent(jLabel3))
.addContainerGap(50, Short.MAX_VALUE))))
@ -544,7 +544,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
.addComponent(signatureTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(signatureLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(isFooterCheckBox)
.addComponent(isTrailingCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(offsetTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
@ -653,8 +653,8 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
/**
* Put it all together and reset the file types list component.
*/
boolean isTrailing = isFooterCheckBox.isSelected();
FileType.Signature signature = new FileType.Signature(signatureBytes, offset, sigType, isFooterCheckBox.isSelected());
boolean isTrailing = isTrailingCheckBox.isSelected();
FileType.Signature signature = new FileType.Signature(signatureBytes, offset, sigType, isTrailingCheckBox.isSelected());
FileType fileType = new FileType(typeName, signature, filesSetName, postHitCheckBox.isSelected());
FileType selected = typesList.getSelectedValue();
if (selected != null) {
@ -684,9 +684,9 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
// TODO add your handling code here:
}//GEN-LAST:event_signatureTextFieldActionPerformed
private void isFooterCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_isFooterCheckBoxActionPerformed
private void isTrailingCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_isTrailingCheckBoxActionPerformed
}//GEN-LAST:event_isFooterCheckBoxActionPerformed
}//GEN-LAST:event_isTrailingCheckBoxActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton deleteTypeButton;
@ -694,7 +694,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
private javax.swing.JTextField filesSetNameTextField;
private javax.swing.JLabel hexPrefixLabel;
private javax.swing.JLabel ingestRunningWarningLabel;
private javax.swing.JCheckBox isFooterCheckBox;
private javax.swing.JCheckBox isTrailingCheckBox;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;