private void syncImages(CachedFile targetFolder){
  Map<String,CachedFile> mapOfImagesToCopy=CatalogManager.getMapOfCatalogImages();
  for (  Map.Entry<String,CachedFile> entry : mapOfImagesToCopy.entrySet()) {
    CachedFile targetFile=CachedFileManager.addCachedFile(targetFolder,entry.getKey());
    try {
      syncFiles(entry.getValue(),targetFile);
    }
 catch (    IOException e) {
      logger.warn("syncImages: Failure copy file '" + entry.getKey() + "' to catalog");
    }
    if (currentProfile.getZipCatalog()) {
      targetFile=CachedFileManager.addCachedFile(CatalogManager.getGenerateFolder(),entry.getKey());
      try {
        syncFiles(entry.getValue(),targetFile);
      }
 catch (      IOException e) {
        logger.warn("syncImages: Failure copy file '" + entry.getKey() + "' to temporary area for ZIP");
      }
    }
  }
}

private void syncImages ( CachedFile targetFolder ) { Map < String , CachedFile > mapOfImagesToCopy = CatalogManager . getMapOfCatalogImages ( ) ; for ( Map . Entry < String , CachedFile > entry : mapOfImagesToCopy . entrySet ( ) ) { CachedFile targetFile = CachedFileManager . addCachedFile ( targetFolder , entry . getKey ( ) ) ; try { syncFiles ( entry . getValue ( ) , targetFile ) ; } catch ( IOException e ) { logger . warn ( "syncImages: Failure copy file '" + entry . getKey ( ) + "' to catalog" ) ; } if ( currentProfile . getZipCatalog ( ) ) { targetFile = CachedFileManager . addCachedFile ( CatalogManager . getGenerateFolder ( ) , entry . getKey ( ) ) ; try { syncFiles ( entry . getValue ( ) , targetFile ) ; } catch ( IOException e ) { logger . warn ( "syncImages: Failure copy file '" + entry . getKey ( ) + "' to temporary area for ZIP" ) ; } } } }
sync a set of image files across to the specified target folder the images are segregated into folders according to the bookid used when images are stored within catalog . if we are going to zip the files then we also need to put the images into the temprorary folder area so that they get picked up by the zip catalog procedure .
