code: protected static byte[] getHistoricalResourceContent(CmsObject cms, String resource, String version) {
  
          if (CmsStringUtil.isNotEmpty(resource) && CmsStringUtil.isNotEmpty(version)) {
              // try to load the historical resource
              I_CmsHistoryResource res = null;
              String storedSiteRoot = cms.getRequestContext().getSiteRoot();
              try {
                  cms.getRequestContext().setSiteRoot("/");
                  res = cms.readResource(
                      cms.readResource(resource, CmsResourceFilter.ALL).getStructureId(),
                      Integer.parseInt(version));
              } catch (CmsException e) {
                  // can usually be ignored
                  if (LOG.isInfoEnabled()) {
                      LOG.info(e.getLocalizedMessage());
                  }
                  return "".getBytes();
              } finally {
                  cms.getRequestContext().setSiteRoot(storedSiteRoot);
              }
              if (res.isFile()) {
                  byte[] historyResourceContent = ((CmsFile)res).getContents();
                  if ((historyResourceContent == null) || (historyResourceContent.length == 0)) {
                      try {
                          CmsFile file = cms.readFile((CmsResource)res);
                          historyResourceContent = file.getContents();
                      } catch (CmsException e) {
                          // ignore
                      }
                  }
                  historyResourceContent = CmsEncoder.changeEncoding(
                      historyResourceContent,
                      OpenCms.getSystemInfo().getDefaultEncoding(),
                      cms.getRequestContext().getEncoding());
                  return historyResourceContent;
              }
          }
          return "".getBytes();
      }
docs: Returns the content of an historical resource.<p>
  
  @param cms a CmsObject
  @param resource the name of the historical resource
  @param version the version number of the historical resource
  
  @return the content of an historical resource