component-installation-plugin / com.intershop.gradle.component.installation.utils / TreeNode

TreeNode

class TreeNode

An implementation for a tree data to configure the clean up task.

Parameters

name - name of the tree node

Constructors

<init>

TreeNode(name: String)

An implementation for a tree data to configure the clean up task.

Properties

children

var children: MutableSet<TreeNode>

Set of child objects of this tree node.

name

val name: String

name of the tree node

parent

var parent: TreeNode?

The parent node of this node.

target

var target: Boolean

If this value is true the node is a configured target item.

Functions

addChild

fun addChild(node: TreeNode): TreeNode

Add a child node to the current node, if the node does not exists in the list.

addPath

fun addPath(path: String): TreeNode

Add path to the current node. The path separator is a slash. If path is an empty string, no new node is added.

addPaths

fun addPaths(vararg pathEntry: String): TreeNode

Add path elements to the current node.

distinctFiles

fun distinctFiles(rootDir: File): Collection<File>

Compares the current child set with a list of node directories. Directories will be returned that are not in the list.

distinctNodes

fun distinctNodes(nodenames: List<String>): Collection<String>

Compares the current child set with a list of node names. Nodes will be returned that are not in the current list.

getChild

fun getChild(childname: String): TreeNode?

Returns the tree node with the given child name or null, if the child name is not available.

getPath

fun getPath(): String

Returns the path of a this node.

intersectFiles

fun intersectFiles(rootDir: File): Collection<File>

Compares the current child set with a list of node directories. Directories will be returned that are in booth list.

intersectNodes

fun intersectNodes(nodenames: List<String>): Collection<String>

Compares the current child set with a list of node names. Nodes will be returned that are in booth list.

isChild

fun isChild(childname: String): Boolean

Verify if the name a child of the current node.

isTarget

fun isTarget(dir: File): Boolean

Returns true if the directory is a configured target.

toString

fun toString(): String

Returns the name of the node.