code: public String format(String value) {
          StringBuilder s = new StringBuilder();
  
          if (value != null && value.trim().length() > 0) {
              boolean continuationLine = false;
  
              s.append(getName()).append(":");
              if (isFirstLineEmpty()) {
                  s.append("\n");
                  continuationLine = true;
              }
  
              try {
                  BufferedReader reader = new BufferedReader(new StringReader(value));
                  String line;
                  while ((line = reader.readLine()) != null) {
                      if (continuationLine && line.trim().length() == 0) {
                          // put a dot on the empty continuation lines
                          s.append(" .\n");
                      } else {
                          s.append(" ").append(line).append("\n");
                      }
  
                      continuationLine = true;
                  }
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
  
          return s.toString();
      }
docs: Returns the field with the specified value properly formatted. Multiline
  values are automatically indented, and dots are added on the empty lines.
  
  <pre>
  Field-Name: value
  </pre>