code: public static String quoteName(String name) {
          StringBuilder sb = new StringBuilder();
  
          int len = name.length();
          for (int i = 0; i < len; i++) {
              char c = name.charAt(i);
  
              if (c == '\\' || c == '"') {
                  sb.append('\\');
              }
  
              sb.append(c);
          }
  
          return sb.toString();
      }
docs: Returns the name, with internal backslashes and quotation marks
  preceded by backslashes.  The outer quote marks themselves are not
  added by this method.