child : this.children) {
+ if (child.getData().equals(data)) {
+ samePathExistsInChildren = true;
+ }
+ }
+ return samePathExistsInChildren;
+ }
+
+ public String getUrl() {
+ if (this.parent == null) {
+ return "./" + this.data;
+ }
+ return this.parent.getUrl() + "/" + this.data;
+ }
+
+ public boolean isRoot() {
+ return (this.parent == null);
+ }
+
+ public boolean isLeaf() {
+ return this.children.size() == 0;
+ }
+
+ public T getData() {
+ return this.data;
+ }
+
+}
diff --git a/app/src/main/java/com/genne23v/openssg/FileUtilities.java b/app/src/main/java/com/genne23v/openssg/FileUtilities.java
new file mode 100644
index 0000000..d89ee7c
--- /dev/null
+++ b/app/src/main/java/com/genne23v/openssg/FileUtilities.java
@@ -0,0 +1,271 @@
+package com.genne23v.openssg;
+
+import java.io.*;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.nio.file.LinkOption;
+import java.util.ArrayList;
+import java.util.Scanner;
+
+public class FileUtilities {
+ static final String UTF8 = "UTF-8";
+ static final String MD = ".md";
+ static final String TXT = ".txt";
+ static final String HTML = ".html";
+ static final String DOCTYPE = "\n";
+ static final String META_TAGS = "\n\s\s\n\s\s\n";
+ static final String HEADER_CLOSING_TAG = "\n\n\n";
+ static final String MAIN_OPENING_TAG = "";
+ static final String BODY_CLOSING_TAGS = "\n
\n\n