code: protected static CmsFile readFile(CmsObject cms, CmsUUID structureId, String version) throws CmsException {
  
          if (Integer.parseInt(version) == CmsHistoryResourceHandler.PROJECT_OFFLINE_VERSION) {
              // offline
              CmsResource resource = cms.readResource(structureId, CmsResourceFilter.IGNORE_EXPIRATION);
              return cms.readFile(resource);
          } else {
              int ver = Integer.parseInt(version);
              if (ver < 0) {
                  // online
                  CmsProject project = cms.getRequestContext().getCurrentProject();
                  try {
                      cms.getRequestContext().setCurrentProject(cms.readProject(CmsProject.ONLINE_PROJECT_ID));
                      CmsResource resource = cms.readResource(structureId, CmsResourceFilter.IGNORE_EXPIRATION);
                      return cms.readFile(resource);
                  } finally {
                      cms.getRequestContext().setCurrentProject(project);
                  }
              }
              // backup
              return cms.readFile((CmsHistoryFile)cms.readResource(structureId, ver));
          }
      }
docs: Returns either the historical file or the offline file, depending on the version number.<p>
  
  @param cms the CmsObject to use
  @param structureId the structure id of the file
  @param version the historical version number
  
  @return either the historical file or the offline file, depending on the version number
  
  @throws CmsException if something goes wrong