@Test public void dumpConfiguration() throws Exception { StringBuilder out = new StringBuilder(); Util.dumpConfiguration(out); String s = out.toString(); assertTrue(s.startsWith("<table")); String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + s; DocumentBuilderFactory.newInstance().newDocumentBuilder().parse( new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8))); }
@SuppressWarnings("boxing") public static void dumpConfiguration(Appendable out) throws IOException, HistoryException { out.append("<table border=\"1\" width=\"100%\">"); out.append("<tr><th>Variable</th><th>Value</th></tr>"); RuntimeEnvironment env = RuntimeEnvironment.getInstance(); printTableRow(out, "Source root", env.getSourceRootPath()); printTableRow(out, "Data root", env.getDataRootPath()); printTableRow(out, "CTags", env.getCtags()); printTableRow(out, "Bug page", env.getBugPage()); printTableRow(out, "Bug pattern", env.getBugPattern()); printTableRow(out, "User page", env.getUserPage()); printTableRow(out, "User page suffix", env.getUserPageSuffix()); printTableRow(out, "Review page", env.getReviewPage()); printTableRow(out, "Review pattern", env.getReviewPattern()); printTableRow(out, "Using projects", env.isProjectsEnabled()); out.append("<tr><td>Ignored files</td><td>"); printUnorderedList(out, env.getIgnoredNames().getItems()); out.append("</td></tr>"); printTableRow(out, "lucene RAM_BUFFER_SIZE_MB", env.getRamBufferSize()); printTableRow(out, "Allow leading wildcard in search", env.isAllowLeadingWildcard()); printTableRow(out, "History cache", HistoryGuru.getInstance() .getCacheInfo()); printTableRow(out, "Authorization plugin directory", env.getPluginDirectory()); printTableRow(out, "Authorization watchdog directory", env.getPluginDirectory()); printTableRow(out, "Authorization watchdog enabled", env.isAuthorizationWatchdog()); printTableRow(out, "Authorization stack", "<pre>" + env.getAuthorizationFramework().getStack().hierarchyToString() + "</pre>"); out.append("</table>"); }
Util { @SuppressWarnings("boxing") public static void dumpConfiguration(Appendable out) throws IOException, HistoryException { out.append("<table border=\"1\" width=\"100%\">"); out.append("<tr><th>Variable</th><th>Value</th></tr>"); RuntimeEnvironment env = RuntimeEnvironment.getInstance(); printTableRow(out, "Source root", env.getSourceRootPath()); printTableRow(out, "Data root", env.getDataRootPath()); printTableRow(out, "CTags", env.getCtags()); printTableRow(out, "Bug page", env.getBugPage()); printTableRow(out, "Bug pattern", env.getBugPattern()); printTableRow(out, "User page", env.getUserPage()); printTableRow(out, "User page suffix", env.getUserPageSuffix()); printTableRow(out, "Review page", env.getReviewPage()); printTableRow(out, "Review pattern", env.getReviewPattern()); printTableRow(out, "Using projects", env.isProjectsEnabled()); out.append("<tr><td>Ignored files</td><td>"); printUnorderedList(out, env.getIgnoredNames().getItems()); out.append("</td></tr>"); printTableRow(out, "lucene RAM_BUFFER_SIZE_MB", env.getRamBufferSize()); printTableRow(out, "Allow leading wildcard in search", env.isAllowLeadingWildcard()); printTableRow(out, "History cache", HistoryGuru.getInstance() .getCacheInfo()); printTableRow(out, "Authorization plugin directory", env.getPluginDirectory()); printTableRow(out, "Authorization watchdog directory", env.getPluginDirectory()); printTableRow(out, "Authorization watchdog enabled", env.isAuthorizationWatchdog()); printTableRow(out, "Authorization stack", "<pre>" + env.getAuthorizationFramework().getStack().hierarchyToString() + "</pre>"); out.append("</table>"); } }
Util { @SuppressWarnings("boxing") public static void dumpConfiguration(Appendable out) throws IOException, HistoryException { out.append("<table border=\"1\" width=\"100%\">"); out.append("<tr><th>Variable</th><th>Value</th></tr>"); RuntimeEnvironment env = RuntimeEnvironment.getInstance(); printTableRow(out, "Source root", env.getSourceRootPath()); printTableRow(out, "Data root", env.getDataRootPath()); printTableRow(out, "CTags", env.getCtags()); printTableRow(out, "Bug page", env.getBugPage()); printTableRow(out, "Bug pattern", env.getBugPattern()); printTableRow(out, "User page", env.getUserPage()); printTableRow(out, "User page suffix", env.getUserPageSuffix()); printTableRow(out, "Review page", env.getReviewPage()); printTableRow(out, "Review pattern", env.getReviewPattern()); printTableRow(out, "Using projects", env.isProjectsEnabled()); out.append("<tr><td>Ignored files</td><td>"); printUnorderedList(out, env.getIgnoredNames().getItems()); out.append("</td></tr>"); printTableRow(out, "lucene RAM_BUFFER_SIZE_MB", env.getRamBufferSize()); printTableRow(out, "Allow leading wildcard in search", env.isAllowLeadingWildcard()); printTableRow(out, "History cache", HistoryGuru.getInstance() .getCacheInfo()); printTableRow(out, "Authorization plugin directory", env.getPluginDirectory()); printTableRow(out, "Authorization watchdog directory", env.getPluginDirectory()); printTableRow(out, "Authorization watchdog enabled", env.isAuthorizationWatchdog()); printTableRow(out, "Authorization stack", "<pre>" + env.getAuthorizationFramework().getStack().hierarchyToString() + "</pre>"); out.append("</table>"); } private  Util(); }
Util { @SuppressWarnings("boxing") public static void dumpConfiguration(Appendable out) throws IOException, HistoryException { out.append("<table border=\"1\" width=\"100%\">"); out.append("<tr><th>Variable</th><th>Value</th></tr>"); RuntimeEnvironment env = RuntimeEnvironment.getInstance(); printTableRow(out, "Source root", env.getSourceRootPath()); printTableRow(out, "Data root", env.getDataRootPath()); printTableRow(out, "CTags", env.getCtags()); printTableRow(out, "Bug page", env.getBugPage()); printTableRow(out, "Bug pattern", env.getBugPattern()); printTableRow(out, "User page", env.getUserPage()); printTableRow(out, "User page suffix", env.getUserPageSuffix()); printTableRow(out, "Review page", env.getReviewPage()); printTableRow(out, "Review pattern", env.getReviewPattern()); printTableRow(out, "Using projects", env.isProjectsEnabled()); out.append("<tr><td>Ignored files</td><td>"); printUnorderedList(out, env.getIgnoredNames().getItems()); out.append("</td></tr>"); printTableRow(out, "lucene RAM_BUFFER_SIZE_MB", env.getRamBufferSize()); printTableRow(out, "Allow leading wildcard in search", env.isAllowLeadingWildcard()); printTableRow(out, "History cache", HistoryGuru.getInstance() .getCacheInfo()); printTableRow(out, "Authorization plugin directory", env.getPluginDirectory()); printTableRow(out, "Authorization watchdog directory", env.getPluginDirectory()); printTableRow(out, "Authorization watchdog enabled", env.isAuthorizationWatchdog()); printTableRow(out, "Authorization stack", "<pre>" + env.getAuthorizationFramework().getStack().hierarchyToString() + "</pre>"); out.append("</table>"); } private  Util(); static String prehtmlize(String s); static String prehtmlize(CharSequence q); static void qurlencode(String str, Appendable dest); static String htmlize(String s); static String htmlize(CharSequence q); static void htmlize(CharSequence q, Appendable dest, boolean pre); static void htmlize(CharSequence q, Appendable dest); static void htmlize(char[] cs, int length, Appendable dest); static String breadcrumbPath(String urlPrefix, String path); static String breadcrumbPath(String urlPrefix, String path, char sep); static String breadcrumbPath(String urlPrefix, String path,
            char sep, String urlPostfix, boolean compact); static String breadcrumbPath(String urlPrefix, String path,
            char sep, String urlPostfix, boolean compact, boolean isDir); static String getCanonicalPath(String path, char sep); static String getEmail(String author); static String readableSize(long num); static String readableCount(long count); static String encode(String s); static void encode(String s, Appendable dest); static String encodeURL(String urlStr); static void readableLine(int num, Writer out, Annotation annotation,
            String userPageLink, String userPageSuffix, String project); static void readableLine(int num, Writer out, Annotation annotation, String userPageLink,
            String userPageSuffix, String project, boolean skipNewline); static String path2uid(String path, String date); static String uid2url(String uid); static String fixPathIfWindows(String path); static void writeHAD(Writer out, String ctxE, String entry,
            boolean is_dir); static String URIEncode(String q); static void URIEncode(String str, Appendable dest); static void appendQuery(StringBuilder buf, String key,
            String value); static String URIEncodePath(String path); static String formQuoteEscape(String q); static String[] diffline(StringBuilder line1, StringBuilder line2); @SuppressWarnings("boxing") static void dumpConfiguration(Appendable out); static void dump(Writer out, Reader in); static boolean dump(Writer out, File dir, String filename,
            boolean compressed); static boolean dump(Writer out, File file, boolean compressed); static boolean dumpXref(Writer out, File file, boolean compressed,
            String contextPath); static void dumpXref(Writer out, Reader in, String contextPath); static String jsStringLiteral(String str); static String stripPathPrefix(String prefix, String fullPath); static String createSlider(int offset, int limit, int size); static String createSlider(int offset, int limit, long size, HttpServletRequest request); static boolean isHttpUri(String string); static String redactUrl(String path); static String linkify(String url); static String linkify(String url, boolean newTab); static String buildLink(String name, Map<String, String> attrs); static String buildLink(String name, String url); static String buildLink(String name, String url, boolean newTab); static String linkifyPattern(String text, Pattern pattern, String name, String url); static String completeUrl(String url, HttpServletRequest req); static Map<String, List<String>> getQueryParams(final URL url); }
Util { @SuppressWarnings("boxing") public static void dumpConfiguration(Appendable out) throws IOException, HistoryException { out.append("<table border=\"1\" width=\"100%\">"); out.append("<tr><th>Variable</th><th>Value</th></tr>"); RuntimeEnvironment env = RuntimeEnvironment.getInstance(); printTableRow(out, "Source root", env.getSourceRootPath()); printTableRow(out, "Data root", env.getDataRootPath()); printTableRow(out, "CTags", env.getCtags()); printTableRow(out, "Bug page", env.getBugPage()); printTableRow(out, "Bug pattern", env.getBugPattern()); printTableRow(out, "User page", env.getUserPage()); printTableRow(out, "User page suffix", env.getUserPageSuffix()); printTableRow(out, "Review page", env.getReviewPage()); printTableRow(out, "Review pattern", env.getReviewPattern()); printTableRow(out, "Using projects", env.isProjectsEnabled()); out.append("<tr><td>Ignored files</td><td>"); printUnorderedList(out, env.getIgnoredNames().getItems()); out.append("</td></tr>"); printTableRow(out, "lucene RAM_BUFFER_SIZE_MB", env.getRamBufferSize()); printTableRow(out, "Allow leading wildcard in search", env.isAllowLeadingWildcard()); printTableRow(out, "History cache", HistoryGuru.getInstance() .getCacheInfo()); printTableRow(out, "Authorization plugin directory", env.getPluginDirectory()); printTableRow(out, "Authorization watchdog directory", env.getPluginDirectory()); printTableRow(out, "Authorization watchdog enabled", env.isAuthorizationWatchdog()); printTableRow(out, "Authorization stack", "<pre>" + env.getAuthorizationFramework().getStack().hierarchyToString() + "</pre>"); out.append("</table>"); } private  Util(); static String prehtmlize(String s); static String prehtmlize(CharSequence q); static void qurlencode(String str, Appendable dest); static String htmlize(String s); static String htmlize(CharSequence q); static void htmlize(CharSequence q, Appendable dest, boolean pre); static void htmlize(CharSequence q, Appendable dest); static void htmlize(char[] cs, int length, Appendable dest); static String breadcrumbPath(String urlPrefix, String path); static String breadcrumbPath(String urlPrefix, String path, char sep); static String breadcrumbPath(String urlPrefix, String path,
            char sep, String urlPostfix, boolean compact); static String breadcrumbPath(String urlPrefix, String path,
            char sep, String urlPostfix, boolean compact, boolean isDir); static String getCanonicalPath(String path, char sep); static String getEmail(String author); static String readableSize(long num); static String readableCount(long count); static String encode(String s); static void encode(String s, Appendable dest); static String encodeURL(String urlStr); static void readableLine(int num, Writer out, Annotation annotation,
            String userPageLink, String userPageSuffix, String project); static void readableLine(int num, Writer out, Annotation annotation, String userPageLink,
            String userPageSuffix, String project, boolean skipNewline); static String path2uid(String path, String date); static String uid2url(String uid); static String fixPathIfWindows(String path); static void writeHAD(Writer out, String ctxE, String entry,
            boolean is_dir); static String URIEncode(String q); static void URIEncode(String str, Appendable dest); static void appendQuery(StringBuilder buf, String key,
            String value); static String URIEncodePath(String path); static String formQuoteEscape(String q); static String[] diffline(StringBuilder line1, StringBuilder line2); @SuppressWarnings("boxing") static void dumpConfiguration(Appendable out); static void dump(Writer out, Reader in); static boolean dump(Writer out, File dir, String filename,
            boolean compressed); static boolean dump(Writer out, File file, boolean compressed); static boolean dumpXref(Writer out, File file, boolean compressed,
            String contextPath); static void dumpXref(Writer out, Reader in, String contextPath); static String jsStringLiteral(String str); static String stripPathPrefix(String prefix, String fullPath); static String createSlider(int offset, int limit, int size); static String createSlider(int offset, int limit, long size, HttpServletRequest request); static boolean isHttpUri(String string); static String redactUrl(String path); static String linkify(String url); static String linkify(String url, boolean newTab); static String buildLink(String name, Map<String, String> attrs); static String buildLink(String name, String url); static String buildLink(String name, String url, boolean newTab); static String linkifyPattern(String text, Pattern pattern, String name, String url); static String completeUrl(String url, HttpServletRequest req); static Map<String, List<String>> getQueryParams(final URL url);  }