diff --git a/out/testfile b/out/testfile deleted file mode 100644 index 5564c5f..0000000 --- a/out/testfile +++ /dev/null @@ -1,2 +0,0 @@ - -Basic Content diff --git a/out/testfile.html b/out/testfile.html new file mode 100644 index 0000000..ddb8d10 --- /dev/null +++ b/out/testfile.html @@ -0,0 +1,14 @@ + + + + + + + +SigPlace +Basic Content + + + diff --git a/ref/DEFAULT.html b/ref/DEFAULT.html new file mode 100644 index 0000000..6155e56 --- /dev/null +++ b/ref/DEFAULT.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ref/FOOTER.html b/ref/FOOTER.html new file mode 100644 index 0000000..f24e41b --- /dev/null +++ b/ref/FOOTER.html @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/sigPlace.java b/sigPlace.java index e363b2d..223d194 100644 --- a/sigPlace.java +++ b/sigPlace.java @@ -1,6 +1,5 @@ import java.io.IOException; import java.nio.charset.Charset; -import java.nio.file.FileStore; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -10,49 +9,60 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.regex.Pattern; import java.util.stream.Collectors; public class sigPlace { final static String ROOTDIR = "sitefiles"; + final static String REFDIR = "ref"; final static String OUTDIR = "out"; final static HashMap map = new HashMap<>(Map.ofEntries( new AbstractMap.SimpleEntry<>("$SITENAME", "SigPlace") )); - final static HashMap ops = new HashMap<>(Map.ofEntries( + final static HashMap ops = new HashMap<>(Map.ofEntries( new AbstractMap.SimpleEntry<>( - "%DEFAULT", - ""+ - ""+ - ""+ - ""+ - "") + "%DEFAULT", Paths.get(REFDIR,"DEFAULT.html")), + new AbstractMap.SimpleEntry<>( + "%FOOTER", Paths.get(REFDIR,"FOOTER.html")) )); public static void main(String[] args) { Set files = GetFilesInDir(ROOTDIR); for (Path f : files) { - System.out.println("Found "+f.getFileName()); + System.out.println(" Found "+f.getFileName()); try { - System.out.println("Preparing "+f.getFileName()); + System.out.println(" Preparing "+f.getFileName()); List content = Files.readAllLines(f); - content.add(0,ops.get("%DEFAULT")); + content.addAll(0,Files.readAllLines(ops.get("%DEFAULT"))); + content.addAll(Files.readAllLines(ops.get("%FOOTER"))); + + System.out.println(" Parsing "+f.getFileName()); + for (int i=0;i GetFilesInDir(String directory) { Path dir = Paths.get(directory); diff --git a/sitefiles/testfile b/sitefiles/testfile deleted file mode 100644 index cb86278..0000000 --- a/sitefiles/testfile +++ /dev/null @@ -1 +0,0 @@ -Basic Content diff --git a/sitefiles/testfile.html b/sitefiles/testfile.html new file mode 100644 index 0000000..258944b --- /dev/null +++ b/sitefiles/testfile.html @@ -0,0 +1,2 @@ +$SITENAME +Basic Content \ No newline at end of file