tds/src/main/java/thredds/core/ConfigCatalogHtmlWriter.java
String convertCatalogToHtml(Catalog cat, boolean isLocalCatalog) {
    StringBuilder sb = new StringBuilder(10000);

    String uri = cat.getUriString();
    if (uri == null) uri = cat.getName();
    if (uri == null) uri = "unknown";
    String catname = Escape.html(uri);

    // Render the page header
    sb.append(getHtmlDoctypeAndOpenTag()); // "<html>\n" );
    sb.append("<head>\r\n");
    sb.append("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>");
    sb.append("<title>");
    //if (cat.isStatic())
    //  sb.append("TdsStaticCatalog ").append(catname); // for searching
    //else
    sb.append("Catalog ").append(catname);
    sb.append("</title>\r\n");
    sb.append(getTdsCatalogCssLink()).append("\n");
    sb.append(this.getGoogleTrackingContent());
    sb.append("</head>\r\n");
    sb.append("<body>");
    sb.append("<h1>");

    // Logo
    //String logoUrl = this.htmlConfig.getInstallLogoUrl();
    String logoUrl = htmlConfig.prepareUrlStringForHtml(htmlConfig.getInstallLogoUrl());
    if (logoUrl != null) {
      sb.append("<img src='").append(logoUrl);
      String logoAlt = htmlConfig.getInstallLogoAlt();
      if (logoAlt != null) sb.append("' alt='").append(logoAlt);
      sb.append("' align='left' valign='top'").append(">\n");
    }

    sb.append(" Catalog ").append(catname);
    sb.append("</h1>");
    sb.append("<HR size='1' noshade='noshade'>");

    sb.append("<table width='100%' cellspacing='0' cellpadding='5' align='center'>\r\n");

    // Render the column headings
    sb.append("<tr>\r\n");
    sb.append("<th align='left'><font size='+1'>");
    sb.append("Dataset");
    sb.append("</font></th>\r\n");
    sb.append("<th align='center'><font size='+1'>");
    sb.append("Size");
    sb.append("</font></th>\r\n");
    sb.append("<th align='right'><font size='+1'>");
    sb.append("Last Modified");
    sb.append("</font></th>\r\n");
    sb.append("</tr>");

    // Recursively render the datasets
    doDatasets(cat, cat.getDatasetsLocal(), sb, false, 0, isLocalCatalog);

    // Render the page footer
    sb.append("</table>\r\n");
    sb.append("<HR size='1' noshade='noshade'>");
    appendSimpleFooter(sb);
    sb.append("</body>\r\n");
    sb.append("</html>\r\n");

    return (sb.toString());
  }
String convertCatalogToHtml(Catalog cat, boolean isLocalCatalog) {
    StringBuilder sb = new StringBuilder(10000);

    String uri = cat.getUriString();
    if (uri == null) uri = cat.getName();
    if (uri == null) uri = "unknown";
    String catname = Escape.html(uri);

    // Render the page header
    sb.append(getHtmlDoctypeAndOpenTag()); // "<html>\n" );
    sb.append("<head>\r\n");
    sb.append("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>");
    sb.append("<title>");
    //if (cat.isStatic())
    //  sb.append("TdsStaticCatalog ").append(catname); // for searching
    //else
    sb.append("Catalog ").append(catname);
    sb.append("</title>\r\n");
    sb.append(getTdsCatalogCssLink()).append("\n");
    sb.append(this.getGoogleTrackingContent());
    sb.append("</head>\r\n");
    sb.append("<body>");
    sb.append("<h1>");

    // Logo
    //String logoUrl = this.htmlConfig.getInstallLogoUrl();
    String logoUrl = htmlConfig.prepareUrlStringForHtml(htmlConfig.getInstallLogoUrl());
    if (logoUrl != null) {
      sb.append("<img src='").append(logoUrl);
      String logoAlt = htmlConfig.getInstallLogoAlt();
      if (logoAlt != null) sb.append("' alt='").append(logoAlt);
      sb.append("' align='left' valign='top'").append(">\n");
    }

    sb.append(" Catalog ").append(catname);
    sb.append("</h1>");
    sb.append("<HR size='1' noshade='noshade'>");

    sb.append("<table width='100%' cellspacing='0' cellpadding='5' align='center'>\r\n");

    // Render the column headings
    sb.append("<tr>\r\n");
    sb.append("<th align='left'><font size='+1'>");
    sb.append("Dataset");
    sb.append("</font></th>\r\n");
    sb.append("<th align='center'><font size='+1'>");
    sb.append("Size");
    sb.append("</font></th>\r\n");
    sb.append("<th align='right'><font size='+1'>");
    sb.append("Last Modified");
    sb.append("</font></th>\r\n");
    sb.append("</tr>");

    // Recursively render the datasets
    doDatasets(cat, cat.getDatasetsLocal(), sb, false, 0, isLocalCatalog);

    // Render the page footer
    sb.append("</table>\r\n");
    sb.append("<HR size='1' noshade='noshade'>");
    appendSimpleFooter(sb);
    sb.append("</body>\r\n");
    sb.append("</html>\r\n");

    return (sb.toString());
  }
String convertCatalogToHtml ( Catalog cat , boolean isLocalCatalog ) { StringBuilder sb = new StringBuilder ( 10000 ) ; String uri = cat . getUriString ( ) ; if ( uri == null ) uri = cat . getName ( ) ; if ( uri == null ) uri = "unknown" ; String catname = Escape . html ( uri ) ; // Render the page header sb . append ( getHtmlDoctypeAndOpenTag ( ) ) ; // "<html>\n" ); sb . append ( "<head>\r\n" ) ; sb . append ( "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>" ) ; sb . append ( "<title>" ) ; //if (cat.isStatic()) //  sb.append("TdsStaticCatalog ").append(catname); // for searching //else sb . append ( "Catalog " ) . append ( catname ) ; sb . append ( "</title>\r\n" ) ; sb . append ( getTdsCatalogCssLink ( ) ) . append ( "\n" ) ; sb . append ( this . getGoogleTrackingContent ( ) ) ; sb . append ( "</head>\r\n" ) ; sb . append ( "<body>" ) ; sb . append ( "<h1>" ) ; // Logo //String logoUrl = this.htmlConfig.getInstallLogoUrl(); String logoUrl = htmlConfig . prepareUrlStringForHtml ( htmlConfig . getInstallLogoUrl ( ) ) ; if ( logoUrl != null ) { sb . append ( "<img src='" ) . append ( logoUrl ) ; String logoAlt = htmlConfig . getInstallLogoAlt ( ) ; if ( logoAlt != null ) sb . append ( "' alt='" ) . append ( logoAlt ) ; sb . append ( "' align='left' valign='top'" ) . append ( ">\n" ) ; } sb . append ( " Catalog " ) . append ( catname ) ; sb . append ( "</h1>" ) ; sb . append ( "<HR size='1' noshade='noshade'>" ) ; sb . append ( "<table width='100%' cellspacing='0' cellpadding='5' align='center'>\r\n" ) ; // Render the column headings sb . append ( "<tr>\r\n" ) ; sb . append ( "<th align='left'><font size='+1'>" ) ; sb . append ( "Dataset" ) ; sb . append ( "</font></th>\r\n" ) ; sb . append ( "<th align='center'><font size='+1'>" ) ; sb . append ( "Size" ) ; sb . append ( "</font></th>\r\n" ) ; sb . append ( "<th align='right'><font size='+1'>" ) ; sb . append ( "Last Modified" ) ; sb . append ( "</font></th>\r\n" ) ; sb . append ( "</tr>" ) ; // Recursively render the datasets doDatasets ( cat , cat . getDatasetsLocal ( ) , sb , false , 0 , isLocalCatalog ) ; // Render the page footer sb . append ( "</table>\r\n" ) ; sb . append ( "<HR size='1' noshade='noshade'>" ) ; appendSimpleFooter ( sb ) ; sb . append ( "</body>\r\n" ) ; sb . append ( "</html>\r\n" ) ; return ( sb . toString ( ) ) ; }
Write a catalog in HTML, make it look like a file directory.

@param cat catalog to write
Write a catalog in HTML make it look like a file directory .