public class HTMLUtils
extends Object
Auxiliary functions to work with HTML. The intended use is for reports
.
Constructor and Description |
---|
HTMLUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getHTMLFromFile(File f)
Returns the HTML text from a given file.
|
static String |
getHTMLFromURL(URL url)
Returns the HTML text from a given URL.
|
static String |
net2PlanConfiguration(Map<String,String> net2planParameters)
Returns
Net2Plan -wide options in a HTML String. |
public static String net2PlanConfiguration(Map<String,String> net2planParameters)
Net2Plan
-wide options in a HTML String.net2planParameters
- Net2Plan
-wide optionsNet2Plan
-wide options in a HTML Stringpublic static String getHTMLFromFile(File f)
Returns the HTML text from a given file. It is a wrapper method for getHTMLFromURL()
.
file
- A valid filepublic static String getHTMLFromURL(URL url)
Returns the HTML text from a given URL.
This method is intended for HTML files enclosed into the same JAR file as that enclosing the calling class. Therefore, the URL must point the location of the HTML file within that JAR file.
For example, assuming that a file named "example.html" is in the path "/aux-files/html" within the JAR file, then the calling would be as follows:
String html = HTMLUtils.getHTMLFromURL(getClass().getResource("/aux-files/html/examples.html").toURI().toURL());
Important: Image paths are converted to absolute paths.
url
- A valid URL