Exemplo n.º 1
0
  private static void static_files_copy(Path abs_path_from, Path abs_path_to) throws IOException {
    Path from = abs_path_from.resolve("static");
    Path to = abs_path_to.resolve("static");

    java.nio.file.Files.walkFileTree(
        from,
        EnumSet.of(FileVisitOption.FOLLOW_LINKS),
        Integer.MAX_VALUE,
        new CopyDirectoryVisitor(from, to));
  }
Exemplo n.º 2
0
  private static String pick_template(Path abs_path_from, String name) {
    String template = name + ".vm";
    String val = "default.vm";

    if (java.nio.file.Files.exists(abs_path_from.resolve("templates").resolve(template))) {
      val = template;
    }

    return val;
  }
Exemplo n.º 3
0
  private static Map<String, Vertabrae> extract_files(Path dir) throws IOException {
    Map<String, Vertabrae> file_names = new TreeMap<>();

    DirectoryStream<Path> directory_stream = java.nio.file.Files.newDirectoryStream(dir, "*.md");

    for (Path from_file : directory_stream) {

      Vertabrae vertabrae = new Vertabrae(from_file);

      file_names.put(vertabrae.file_name(), vertabrae);
      System.out.println("[SPINE] Vertabrae file name: " + vertabrae.file_name());
    }
    directory_stream.close();
    return file_names;
  }