1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.linecorp.centraldogma.server.auth.saml;
17
18 import static java.util.Objects.requireNonNull;
19
20 final class HtmlUtil {
21
22 private static final String BEGIN =
23 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
24 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">" +
25 "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">" +
26 "<head><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\" /></head>" +
27 "<body onload=\"";
28
29 private static final String END = "\"></body></html>";
30
31 static String getHtmlWithOnload(String... statements) {
32 requireNonNull(statements, "statements");
33
34 final StringBuilder sb = new StringBuilder(BEGIN);
35 for (String statement : statements) {
36 sb.append(statement).append(';');
37 }
38 sb.append(END);
39 return sb.toString();
40 }
41
42 private HtmlUtil() {}
43 }