Class Utils

java.lang.Object
net.thauvin.erik.httpstatus.Utils

public final class Utils extends Object
The Utils class implements a collection of utility methods used throughout this project.
Since:
1.0
  • Method Details

    • escapeXml

      public static String escapeXml(String value)
      Converts <, >, &, ', " to their corresponding entity codes.
      Parameters:
      value - The string value to convert
      Returns:
      The converted string value
    • outWrite

      public static void outWrite(Writer out, String value, String defaultValue, boolean xml) throws IOException
      Writes a string value to the specified writer, with optional XML escaping. The default value is used when the actual value is null.
      Parameters:
      out - The writer to output the value to
      value - The string value
      defaultValue - The default value
      xml - The xml flag
      Throws:
      IOException - If an I/O error occurs
      NullPointerException - If the writer is null