docs: protected CmsFile getScaledImage(CmsObject cms, CmsResource resource, CmsImageScaler scaler)
      throws IOException, CmsException {
  
          String cacheParam = scaler.isValid() ? scaler.toString() : null;
          String cacheName = m_vfsDiskCache.getCacheName(resource, cacheParam);
          byte[] content = m_vfsDiskCache.getCacheContent(cacheName);
  
          CmsFile file;
          if (content != null) {
              if (resource instanceof CmsFile) {
                  // the original file content must be modified (required e.g. for static export)
                  file = (CmsFile)resource;
              } else {
                  // this is no file, but we don't want to use "upgrade" since we don't need to read the content from the VFS
                  file = new CmsFile(resource);
              }
              // save the content in the file
              file.setContents(content);
          } else {
              // we must read the content from the VFS (if this has not been done yet)
              file = cms.readFile(resource);
              // upgrade the file (load the content)
              if (scaler.isValid()) {
                  if (scaler.getType() == 8) {
                      // only need the focal point for mode 8
                      scaler.setFocalPoint(CmsPreviewService.readFocalPoint(cms, resource));
                  }
                  // valid scaling parameters found, scale the content
                  content = scaler.scaleImage(file);
                  // exchange the content of the file with the scaled version
                  file.setContents(content);
              }
              // save the file content in the cache
              m_vfsDiskCache.saveCacheFile(cacheName, file.getContents());
          }
          return file;
      }