Autopsy
4.19.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) |
Static Private Member Functions | |
static DocumentBuilder | getDocumentBuilder () throws ParserConfigurationException |
static SchemaFactory | getSchemaFactory (String schemaLanguage) |
static TransformerFactory | getTransformerFactory () |
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 99 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.XMLUtil.getDocumentBuilder().
|
staticprivate |
Definition at line 58 of file XMLUtil.java.
Referenced by org.sleuthkit.autopsy.coreutils.XMLUtil.createDocument(), org.sleuthkit.autopsy.coreutils.XMLUtil.loadDoc(), and org.sleuthkit.autopsy.coreutils.XMLUtil.loadDocument().
|
staticprivate |
Definition at line 70 of file XMLUtil.java.
Referenced by org.sleuthkit.autopsy.coreutils.XMLUtil.validateDocument(), and org.sleuthkit.autopsy.coreutils.XMLUtil.xmlIsValid().
|
staticprivate |
Definition at line 81 of file XMLUtil.java.
Referenced by org.sleuthkit.autopsy.coreutils.XMLUtil.saveDoc(), and org.sleuthkit.autopsy.coreutils.XMLUtil.saveDocument().
|
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 259 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.XMLUtil.getDocumentBuilder(), and 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 283 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 117 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 134 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.XMLUtil.getDocumentBuilder().
|
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 300 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.Logger.getLogger(), and org.sleuthkit.autopsy.coreutils.XMLUtil.getTransformerFactory().
|
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 173 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.XMLUtil.getTransformerFactory().
|
static |
Validates a WC3 DOM using a schema packaged as a class resource.
doc | |
clazz | |
schemaResourceName |
SAXException | |
IOException |
Definition at line 150 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.PlatformUtil.extractResourceToUserConfigDir(), org.sleuthkit.autopsy.coreutils.XMLUtil.getSchemaFactory(), 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 208 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.PlatformUtil.extractResourceToUserConfigDir(), org.sleuthkit.autopsy.coreutils.Logger.getLogger(), org.sleuthkit.autopsy.coreutils.XMLUtil.getSchemaFactory(), 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 247 of file XMLUtil.java.
References org.sleuthkit.autopsy.coreutils.XMLUtil.xmlIsValid().
Copyright © 2012-2021 Basis Technology. Generated on: Fri Aug 6 2021
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.