Commit 3ca474ab authored by Olli Ala-Hakula's avatar Olli Ala-Hakula
Browse files

Upload New File

parent 28f8aa4a
Pipeline #45001 failed with stages
in 16 seconds
import java.nio.file.*;
import java.util.*;
import java.util.stream.*;
class SiteGen {
static String siteTitle = "My favorite movies";
static List<String> movieList = List.of(
"Star Wars",
"Star Trek",
"Battlestar Galactica"
);
static String htmlString =
"<html>" +
"<head><title>" + siteTitle + "</title></head>" +
"<body>" +
"<h1>" + siteTitle + "</h1>" +
"<ul>" + movieList.stream().map(i -> "<li>"+ i + "</li>").collect(Collectors.joining()) + "</ul>" +
"</body>" +
"<html>";
public static void main(String args[]) throws Exception {
Files.createDirectory(Paths.get("public/"));
Files.write(Paths.get("public/index.html"), htmlString.getBytes());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment