X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmircoders%2Fservlet%2FServletModuleOpenIndy.java;h=f7fddf043c6ee4d0263a18f91482874974748792;hb=627becfe22637207a6a13f0538cb67bbe96704f4;hp=f7fb1349d27c4cb9ab25172f07874d3ed02b4539;hpb=d808fabb2b72e9b076bb59314729edad0c92af39;p=mir.git diff --git a/source/mircoders/servlet/ServletModuleOpenIndy.java b/source/mircoders/servlet/ServletModuleOpenIndy.java index f7fb1349..f7fddf04 100755 --- a/source/mircoders/servlet/ServletModuleOpenIndy.java +++ b/source/mircoders/servlet/ServletModuleOpenIndy.java @@ -73,9 +73,23 @@ import mircoders.media.MediaRequest; * 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 * @@ -285,13 +299,15 @@ public class ServletModuleOpenIndy extends ServletModule 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()); } @@ -396,7 +412,7 @@ public class ServletModuleOpenIndy extends ServletModule 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());}