* open-postings to the newswire
*
* @author $Author: mh $
- * @version $Revision: 1.38.2.1 $ $Date: 2002/09/01 21:31:44 $
+ * @version $Revision: 1.38.2.2 $ $Date: 2002/11/01 05:38:21 $
*
* $Log: ServletModuleOpenIndy.java,v $
+ * Revision 1.38.2.2 2002/11/01 05:38:21 mh
+ * Converted media Interface to use streams (Java IO) instead of byte buffers of
+ * the entire uplaoded files. These saves loads of unecessary memory use. JAI
+ * still consumes quite a bit though.
+ *
+ * A new temporary file (for JAI) parameter is necessary and is in the config.properties file.
+ *
+ * A nice side effect of this work is the FileHandler interface which is
+ * basically a call back mechanism for WebdbMultipartRequest which allows the
+ * uploaded file to handled by different classes. For example, for a media
+ * upload, the content-type, etc.. needs to be determined, but if say the
+ * FileEditor had a feature to upload static files... another handler wood be
+ * needed. Right now only the MediaRequest handler exists.
+ *
* Revision 1.38.2.1 2002/09/01 21:31:44 mh
* Mir goes GPL
*
boolean setTopic = false;
try {
- WebdbMultipartRequest mp = new WebdbMultipartRequest(req);
+ WebdbMultipartRequest mp = null;
EntityList mediaList = null;
try {
// new MediaRequest, "1" is the id for the openPosting user
- mediaList = new MediaRequest(mp, "1").getMedia(true, true);
- } catch (MirMediaUserException e) {
+ MediaRequest mediaReq = new MediaRequest("1", true, true);
+ mp = new WebdbMultipartRequest(req, (FileHandler)mediaReq);
+ mediaList = mediaReq.getEntityList();
+ } catch (FileHandlerUserException e) {
throw new ServletModuleUserException(e.getMsg());
}
theLog.printDebugInfo("rsync: "+exitValue);
}
- catch (MirMediaException e) { throw new ServletModuleException("MediaException: "+ e.toString());}
+ catch (FileHandlerException e) { throw new ServletModuleException("MediaException: "+ e.toString());}
catch (IOException e) { throw new ServletModuleException("IOException: "+ e.toString());}
catch (StorageObjectException e) { throw new ServletModuleException("StorageObjectException" + e.toString());}
catch (ModuleException e) { throw new ServletModuleException("ModuleException"+e.toString());}