public class WaffleInfo extends Object
This utility class collects system information and returns it as an XML document.From the command line, you can write the info to stdout using:
java -cp "jna.jar;waffle-core.jar;waffle-api.jar;jna-platform.jar;guava-17.0.jar" waffle.util.WaffleInfo
To show this information in a browser, run:
java -cp "..." waffle.util.WaffleInfo -show
To lookup account names and return any listed info, run:
java -cp "..." waffle.util.WaffleInfo -lookup AccountName
Constructor and Description |
---|
WaffleInfo() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAccountInfo(Document doc,
Element node,
IWindowsAccount account)
Adds the account info.
|
protected Element |
getAuthProviderInfo(Document doc)
Gets the auth provider info.
|
static Element |
getException(Document doc,
Exception t)
Gets the exception.
|
Element |
getLookupInfo(Document doc,
String lookup)
Gets the lookup info.
|
Document |
getWaffleInfo()
Get a Document with basic system information
This uses the builtin javax.xml package even though the API is quite verbose
|
static void |
main(String[] args)
Print system information.
|
static String |
toPrettyXML(Document doc)
To pretty xml.
|
public Document getWaffleInfo() throws ParserConfigurationException
ParserConfigurationException
- when getting new document builder.protected Element getAuthProviderInfo(Document doc)
doc
- the docprotected void addAccountInfo(Document doc, Element node, IWindowsAccount account)
doc
- the docnode
- the nodeaccount
- the accountpublic Element getLookupInfo(Document doc, String lookup)
doc
- the doclookup
- the lookuppublic static Element getException(Document doc, Exception t)
doc
- the doct
- the tpublic static String toPrettyXML(Document doc) throws TransformerException
doc
- the docTransformerException
- the transformer exceptionpublic static void main(String[] args)
args
- variable arguments to pass to main. Valid values are "-show" and "-lookup".Copyright © 2010–2015 com.github.dblock. All rights reserved.