remove predefined sig to add to another pull request

This commit is contained in:
momo 2015-10-27 14:34:14 -04:00
parent 98e43b7666
commit 14c91eb2df
3 changed files with 11 additions and 16 deletions

View File

@ -634,13 +634,8 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
* Get the offset.
*/
long offset;
try {
if(isFooterCheckBox.isSelected()) {
offset = -1;
}
else {
offset = Long.parseUnsignedLong(offsetTextField.getText());
}
try {
offset = isFooterCheckBox.isSelected() ? -1 : Long.parseUnsignedLong(offsetTextField.getText());
} catch (NumberFormatException ex) {
JOptionPane.showMessageDialog(null,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidOffset.message"),

View File

@ -13,19 +13,25 @@
<xs:restriction base="stringType">
<xs:whiteSpace value="preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:simpleType>
<xs:simpleType name="sigInterpretationType">
<xs:restriction base="xs:string">
<xs:enumeration value="RAW"/>
<xs:enumeration value="ASCII"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="nonNegativeMinus1">
<xs:restriction base="xs:integer">
<xs:minInclusive value="-1"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="signatureType">
<xs:sequence>
<xs:element name="Bytes" type="stringType"/>
<xs:element name="Offset" type="xs:nonNegativeInteger"/>
<xs:element name="Offset" type="nonNegativeMinus1"/>
</xs:sequence>
<xs:attribute name="type" type="sigInterpretationType" use="required"/>
</xs:complexType>

View File

@ -224,12 +224,6 @@ final class UserDefinedFileTypesManager {
// Add rule for .pfm
fileType = new FileType("image/x-portable-floatmap", new Signature("PF", 0L), "", false); //NON-NLS
fileTypes.put(fileType.getMimeType(), fileType);
// Add rule for .tga
byteArray = DatatypeConverter.parseHexBinary("54525545564953494F4E2D5846494C452E00");
fileType = new FileType("image/x-tga", new Signature(byteArray, true), "", false); // NON-NLS
fileTypes.put(fileType.getMimeType(), fileType);
}
// parseHexBinary() throws this if the argument passed in is not Hex
catch (IllegalArgumentException e) {