public void transferImage()
 	throws IOException, DBException
 {
  VersionDTO version = getVersion();
  if (null == version)
   throw new IllegalStateException("Cannot transfer an image: target version is not set");
  if (version.isImageAvailable())
   return;
  InputStream image = null;
  Logger log = log();
  log.finer("Transferring image to " + version + " ...");
  try
  {
   image = buildImage();
   db.findDAO(VersionDAO.class).saveImage(version, image);
  }
  catch (Exception ex)
  {
   log.log(Level.SEVERE, "Error transferring " + version, ex);
   if (ex instanceof IOException)
    throw (IOException)ex;
   if (ex instanceof DBException)
    throw (DBException)ex;
   if (ex instanceof RuntimeException)
    throw (RuntimeException)ex;
   else
    throw new RuntimeException(ex);
  }
  finally
  {
   // Allow exception in close() to supersede initial exception
   // as it will store status of asynchronous restore process
   if (null != image)
    image.close();
  }
 }