Package app.service
Class FiletreeOperations
java.lang.Object
app.service.FiletreeOperations
public class FiletreeOperations
extends java.lang.Object
A class containing operations for handling files withing a GUI filetree
-
Method Summary
Modifier and Type Method Description static void
generateTree(java.io.File file, javafx.scene.control.CheckBoxTreeItem<java.lang.String> parent)
Generate a filetree recursively, find icons for every file and append them to the root tree node.static java.nio.file.Path
getPathOfTreeItem(javafx.scene.control.TreeItem<java.lang.String> item)
Determine the absolute path of a file within the filetree.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
generateTree
public static void generateTree(java.io.File file, javafx.scene.control.CheckBoxTreeItem<java.lang.String> parent)Generate a filetree recursively, find icons for every file and append them to the root tree node.- Parameters:
file
- The root directory to be at the top of the treeparent
- The root tree item to append children to
-
getPathOfTreeItem
public static java.nio.file.Path getPathOfTreeItem(javafx.scene.control.TreeItem<java.lang.String> item) throws java.io.FileNotFoundExceptionDetermine the absolute path of a file within the filetree.- Parameters:
item
- The treeitem that represents the file of which path is needed- Returns:
- The absolute path of the file that the treeitem represents
- Throws:
java.io.FileNotFoundException
- if no path was found within the filetree such that the item could be connected with the root tree item. This should not happen
-