cleanup / abuse system fix / prepping for a release
[mir.git] / source / mircoders / media / MediaHandlerImagesExtern.java
index d12f111..ac96478 100755 (executable)
@@ -40,15 +40,12 @@ import mir.log.LoggerWrapper;
 import mir.media.MediaExc;
 import mir.media.MediaFailure;
 import mir.media.image.ImageProcessor;
-// FIXME: delete this when finished testing ImageMagickImageProcessor
-//import mir.media.image.JAIImageProcessor;
 import mir.media.image.ImageMagickImageProcessor;
 import mir.misc.StringUtil;
 
-
 /**
- * Image handler that stores images outside of the database. Will be replaced by the new
- *   media handling system.
+ * Image handler that stores images outside of the database.
+ * 
  * @author Zapata
  * @version 1.0
  */
@@ -75,19 +72,17 @@ public class MediaHandlerImagesExtern extends MediaHandlerGeneric
       String ext = "." + mediaTypeEnt.getFieldValue("name");
       String fileBasePath = datePath + anImageEntity.getId();
       String filePath = fileBasePath + ext;
-      String iconPath = getIconStoragePath() + fileBasePath + ".jpg";
+      String iconPath = getBaseIconStoragePath() + fileBasePath + ".jpg";
       String iconStoragePath = configuration.getString("Producer.StorageRoot") + iconPath;
-      String imageFilePath = getStoragePath() + File.separator + filePath;
+      String imageFilePath = getBaseStoragePath() + File.separator + filePath;
 
       File imageFile = new File(imageFilePath);
       File iconFile = new File(iconStoragePath);
 
       if (!imageFile.exists()) {
-        throw new MediaExc("error in MediaHandlerImagesExtern.produce(): " + filePath + " does not exist!");
+        throw new MediaExc("error in MediaHandlerImagesExtern.execute(): " + filePath + " does not exist!");
       }
       else {
-        // FIXME: delete this when finished testing ImageMagickImageProcessor
-        //        ImageProcessor processor = new JAIImageProcessor(imageFile);
         ImageProcessor processor = new ImageMagickImageProcessor(imageFile);
 
         processor.descaleImage(maxIconSize, minDescaleRatio, minDescaleReduction);
@@ -113,7 +108,7 @@ public class MediaHandlerImagesExtern extends MediaHandlerGeneric
       }
     }
     catch(Throwable t) {
-      logger.error("MediaHandlerImagesExtern.produce: " + t.toString());
+      logger.error("MediaHandlerImagesExtern.execute: " + t.toString());
       t.printStackTrace(logger.asPrintWriter(LoggerWrapper.DEBUG_MESSAGE));
       throw new MediaFailure(t.getMessage(), t);
     }
@@ -142,12 +137,12 @@ public class MediaHandlerImagesExtern extends MediaHandlerGeneric
     return "image/jpeg";
   }
 
-  public String getStoragePath()
+  public String getBaseStoragePath()
   {
     return configuration.getString("Producer.Image.Path");
   }
 
-  public String getIconStoragePath()
+  public String getBaseIconStoragePath()
   {
     return configuration.getString("Producer.Image.IconPath");
   }