Package org.infinispan.tools
Class ToolUtils
- java.lang.Object
-
- org.infinispan.tools.ToolUtils
-
public class ToolUtils extends Object
- Since:
- 10.0
- Author:
- Tristan Tarrant <tristan@infinispan.org>
-
-
Constructor Summary
Constructors Constructor Description ToolUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<Node>findFirstChildByPath(Node parent, String fullPath)Similar tofindFirstChildByTagName(Node, String)but it uses afullPathto search the first child that matches it.static Optional<Node>findFirstChildByTagName(Node parent, String tagName)Given a parentNode, it search all the children and returns the first one to match thetagName.static StringgetBaseFileName(String absoluteFileName)static List<Dependency>parseXMLDependencies(Document document)Parses the "licenses.xml" files generated by the Wildfly licenses-plugin (maven projects) or license-reporter (nodejs projects).static voidprintDocument(Document doc, OutputStream out)static voidremoveEmptyLinesFromFile(File file)Trims all the empty lines from a file.static StringtextFromNode(Node node)
-
-
-
Field Detail
-
EMPTY
public static final String EMPTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
printDocument
public static void printDocument(Document doc, OutputStream out) throws TransformerException
- Throws:
TransformerException
-
findFirstChildByTagName
public static Optional<Node> findFirstChildByTagName(Node parent, String tagName)
Given a parentNode, it search all the children and returns the first one to match thetagName.
-
findFirstChildByPath
public static Optional<Node> findFirstChildByPath(Node parent, String fullPath)
Similar tofindFirstChildByTagName(Node, String)but it uses afullPathto search the first child that matches it.
-
parseXMLDependencies
public static List<Dependency> parseXMLDependencies(Document document)
Parses the "licenses.xml" files generated by the Wildfly licenses-plugin (maven projects) or license-reporter (nodejs projects).- Parameters:
document- TheDocumentto parse.- Returns:
- A
Listwith all theDependencyfound.
-
removeEmptyLinesFromFile
public static void removeEmptyLinesFromFile(File file) throws IOException
Trims all the empty lines from a file.- Parameters:
file- TheFileto trim.- Throws:
IOException- If an i/o error occurs.
-
-