code: protected String getContentAsString(CmsFile file) throws CmsException {
  
          CmsProperty p = m_cms.readPropertyObject(file, CmsPropertyDefinition.PROPERTY_CONTENT_ENCODING, true);
          String e = p.getValue();
          if (e == null) {
              e = OpenCms.getSystemInfo().getDefaultEncoding();
          }
          return CmsEncoder.createString(file.getContents(), e);
      }
docs: Helper method to convert the content of a resource to a string.<p>
  
  @param file the file
  @return the file content as a string
  
  @throws CmsException if something goes wrong