code: private void addMessagesToPropertiesFile(
          Map<String, String> messages,
          CmsFile propertiesFile,
          boolean forcePropertyFileEncoding)
      throws CmsException, UnsupportedEncodingException {
  
          lockTemporary(propertiesFile);
          String encoding = forcePropertyFileEncoding
          ? PROPERTIES_ENCODING
          : CmsFileUtil.getEncoding(m_cms, propertiesFile);
          StringBuffer contentBuffer = new StringBuffer();
          contentBuffer.append(new String(propertiesFile.getContents(), encoding).trim());
          for (Entry<String, String> entry : messages.entrySet()) {
              contentBuffer.append("\n");
              contentBuffer.append(entry.getKey());
              contentBuffer.append("=");
              contentBuffer.append(entry.getValue());
          }
          contentBuffer.append("\n");
          propertiesFile.setContents(contentBuffer.toString().getBytes(encoding));
          m_cms.writeFile(propertiesFile);
      }
docs: Adds the given messages to the workplace properties file.<p>
  
  @param messages the messages
  @param propertiesFile the properties file
  @param forcePropertyFileEncoding flag, indicating if encoding {@link #PROPERTIES_ENCODING} should be forced
  
  @throws CmsException if writing the properties fails
  @throws UnsupportedEncodingException in case of encoding issues