public final class HtmlUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
addCustomCss(File cssFile,
File srcDir,
String documentSrcName)
Add custom CSS with XML wrapper to document source directories.
|
static void |
addHtaccess(String baseDir,
File htaccess)
Add a
.htaccess file to the base directory, for publication
on an Apache HTTPD server. |
static void |
fixResourceLinks(String htmlDir,
String resourcesDirBaseName)
Fix links to arbitrary resources in HTML files.
|
static List<File> |
updateHtml(String baseDir,
Map<String,String> replacements)
Replace HTML tags with additional content.
|
public static void addHtaccess(String baseDir, File htaccess) throws IOException
.htaccess
file to the base directory, for publication
on an Apache HTTPD server.
According to Apache documentation on How directives are applied, "The configuration directives found in a .htaccess file are applied to the directory in which the .htaccess file is found, and to all subdirectories thereof." So there is no need to copy the file recursively to all directories.
baseDir
- Base directory under which to add the filehtaccess
- .htaccess
file to copyIOException
- Something went wrong during copy procedure.public static void addCustomCss(File cssFile, File srcDir, String documentSrcName) throws IOException
See custom.css.source for details.
cssFile
- The CSS file to wrap in XML.srcDir
- The source directory for DocBook XML documents.documentSrcName
- The top-level entry file to DocBook XML documents.IOException
- Something went wrong adding CSS.public static List<File> updateHtml(String baseDir, Map<String,String> replacements) throws IOException
baseDir
- Base directory under which to find HTML files recursivelyreplacements
- Keys are tags to replace. Values are replacements, including
the original tag.IOException
- Something went wrong reading or writing files.public static void fixResourceLinks(String htmlDir, String resourcesDirBaseName) throws IOException
Chunked HTML and webhelp have extra directories in the path.
Links like ../resources/file.txt
that work in the source
do not work as is in these formats.
Instead the links need an extra .. as in ../../resources/file.txt
.
htmlDir
- Path to a directory containing HTML.resourcesDirBaseName
- Base name of the resources directory.IOException
- Something went wrong updating links.Copyright © 2025 Open Identity Platform Community. All rights reserved.