Autopsy
4.7.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
|
Static Public Member Functions | |
static Document | createDocument () throws ParserConfigurationException |
static< T > Document | loadDoc (Class< T > clazz, String xmlPath) |
static< T > Document | loadDoc (Class< T > clazz, String xmlPath, String xsdPath) |
static< T > Document | loadDocument (String docPath, Class< T > clazz, String schemaResourceName) throws IOException, ParserConfigurationException, SAXException |
static Document | loadDocument (String docPath) throws ParserConfigurationException, SAXException, IOException |
static< T > boolean | saveDoc (Class< T > clazz, String xmlPath, String encoding, final Document doc) |
static void | saveDocument (final Document doc, String encoding, String docPath) throws TransformerConfigurationException, FileNotFoundException, UnsupportedEncodingException, TransformerException, IOException |
static< T > void | validateDocument (final Document doc, Class< T > clazz, String schemaResourceName) throws SAXException, IOException |
static< T > boolean | xmlIsValid (DOMSource xmlfile, Class< T > clazz, String schemaFile) |
static< T > boolean | xmlIsValid (Document doc, Class< T > clazz, String type) |
XML Utilities
This class provides basic utilities for working with XML files, such as -Validating XML files against a given schema -Saving documents to disk -Loading documents from disk
Definition at line 56 of file XMLUtil.java.
|
static |
Creates a W3C DOM.
ParserConfigurationException |
Definition at line 65 of file XMLUtil.java.
Referenced by org.sleuthkit.autopsy.casemodule.CaseMetadata.writeToFile().
|
static |
Loads XML files from disk
clazz | the class this method is invoked from |
xmlPath | the full path to the file to load |
Definition at line 228 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.Logger.getLogger().
Referenced by org.sleuthkit.autopsy.coreutils.XMLUtil.loadDoc().
|
static |
Loads XML files from disk
clazz | the class this method is invoked from |
xmlPath | the full path to the file to load |
xsdPath | the full path to the file to validate against |
Definition at line 253 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.Logger.getLogger(), org.sleuthkit.autopsy.coreutils.XMLUtil.loadDoc(), and org.sleuthkit.autopsy.coreutils.XMLUtil.xmlIsValid().
|
static |
Loads an XML document into a WC3 DOM and validates it using a schema packaged as a class resource.
docPath | The full path to the XML document. |
clazz | The class associated with the schema resource. |
schemaResourceName | The name of the schema resource. |
IOException | |
ParserConfigurationException | |
SAXException |
Definition at line 85 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.XMLUtil.validateDocument().
|
static |
Loads an XML document into a WC3 DOM.
docPath | The full path to the XML document. |
ParserConfigurationException | |
SAXException | |
IOException |
Definition at line 102 of file XMLUtil.java.
|
static |
Saves XML files to disk
clazz | the class this method is invoked from |
xmlPath | the full path to save the XML to |
encoding | to encoding, such as "UTF-8", to encode the file with |
doc | the document to save |
Definition at line 270 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.Logger.getLogger().
|
static |
Saves a WC3 DOM by writing it to an XML document.
doc | The WC3 DOM document object. |
docPath | The full path to the XML document. |
encoding | Encoding scheme to use for the XML document, e.g., "UTF-8." |
TransformerConfigurationException | |
FileNotFoundException | |
UnsupportedEncodingException | |
TransformerException | |
IOException |
Definition at line 142 of file XMLUtil.java.
|
static |
Validates a WC3 DOM using a schema packaged as a class resource.
doc | |
clazz | |
schemaResourceName |
SAXException | |
IOException |
Definition at line 119 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.PlatformUtil.extractResourceToUserConfigDir(), and org.sleuthkit.autopsy.coreutils.PlatformUtil.getUserConfigDirectory().
Referenced by org.sleuthkit.autopsy.coreutils.XMLUtil.loadDocument().
|
static |
Utility to validate XML files against pre-defined schema files.
The schema files are extracted automatically when this function is called, the XML being validated is not. Be sure the XML file is already extracted otherwise it will return false.
xmlfile | The XML file to validate, in DOMSource format |
clazz | class frm package to extract schema file from |
schemaFile | The file name of the schema to validate against, must exist as a resource in the same package as where this function is being called. |
For example usages, please see KeywordSearchListsXML, HashDbXML, or IngestModuleLoader.
Definition at line 177 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.PlatformUtil.extractResourceToUserConfigDir(), org.sleuthkit.autopsy.coreutils.Logger.getLogger(), and org.sleuthkit.autopsy.coreutils.PlatformUtil.getUserConfigDirectory().
Referenced by org.sleuthkit.autopsy.coreutils.XMLUtil.loadDoc(), and org.sleuthkit.autopsy.coreutils.XMLUtil.xmlIsValid().
|
static |
Evaluates XML files against an XSD.
The schema files are extracted automatically when this function is called, the XML being validated is not. Be sure the XML file is already extracted otherwise it will return false.
doc | The XML DOM to validate |
clazz | class from package to extract schema from |
type | The file name of the schema to validate against, must exist as a resource in the same package as where this function is being called |
For example usages, please see KeywordSearchListsXML, HashDbXML, or IngestModuleLoader.
Definition at line 216 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.XMLUtil.xmlIsValid().
Copyright © 2012-2016 Basis Technology. Generated on: Mon Jun 18 2018
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.