code: public CmsFile readFile(CmsRequestContext context, CmsResource resource) throws CmsException {
  
          CmsFile result = null;
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              result = m_driverManager.readFile(dbc, resource);
          } catch (Exception e) {
              if (resource instanceof I_CmsHistoryResource) {
                  dbc.report(
                      null,
                      Messages.get().container(
                          Messages.ERR_READ_FILE_HISTORY_2,
                          context.getSitePath(resource),
                          new Integer(resource.getVersion())),
                      e);
              } else {
                  dbc.report(null, Messages.get().container(Messages.ERR_READ_FILE_1, context.getSitePath(resource)), e);
              }
          } finally {
              dbc.clear();
          }
          return result;
      }
docs: Reads a file resource (including it's binary content) from the VFS.<p>
  
  In case you do not need the file content,
  use <code>{@link #readResource(CmsRequestContext, String, CmsResourceFilter)}</code> instead.<p>
  
  @param context the current request context
  @param resource the resource to be read
  
  @return the file read from the VFS
  
  @throws CmsException if something goes wrong