public static String escapeDoubleQuotes(String string) {
    if (string == null) { return null; }
    String result = string.replaceAll("\\\\", "\\\\\\\\");
    return result.replaceAll("\\\"", "\\\\\\\"");
  }