clean out deadwood
[mir.git] / source / mircoders / media / MediaRequest.java
index d3a9f41..087df33 100755 (executable)
@@ -55,7 +55,7 @@ import mir.media.*;
  *    appropriate media objects are set.
  *
  * @author mh
- * @version $Id: MediaRequest.java,v 1.4 2002/11/22 11:57:52 john Exp $
+ * @version $Id: MediaRequest.java,v 1.8 2002/11/29 06:38:27 mh Exp $
  *
  */
 
@@ -144,9 +144,12 @@ public class MediaRequest implements FileHandler
       }
 
       String mediaTitle = (String)mediaValues.get("media_title"+fileNum);
-      if ( (mediaTitle == null) || (mediaTitle.length() == 0))
-       mediaTitle="media item "+fileNum;
-       //    throw new FileHandlerUserException("Missing field: media title "+mediaTitle+fileNum);
+      if ( (mediaTitle == null) || (mediaTitle.length() == 0)) {
+        //  uncomment the next line and comment out the exception throw
+        //  if you'd rather just assign missing media titles automatically
+        //  mediaTitle="media item "+fileNum;
+        throw new FileHandlerUserException("Missing field: media title "+mediaTitle+fileNum);
+      }
 
       // TODO: need to add all the extra fields that can be present in the 
       // admin upload form. -mh
@@ -233,20 +236,6 @@ public class MediaRequest implements FileHandler
       mediaEnt.setValues(mediaValues);
       mediaId = mediaEnt.insert();
 
-      //try {
-      //  File f = null;
-      //  f = new File("/tmp/img.jpg");
-      //  File dir = new File(f.getParent());
-      //  dir.mkdirs();
-
-      //  FileOutputStream out = new FileOutputStream(f);
-      //  System.out.println("WRITE");
-      //  filePart.writeTo(out);
-      //  out.close();
-      //} catch (Exception e) {System.out.println("EE "+e.toString());}
-
-
-      //mir.misc.FileUtil.write("/tmp/img.jpg", filePart.getInputStream());
       //save and store the media data/metadata
       try {
         mediaHandler.set(filePart.getInputStream(), mediaEnt, mediaType);