From 917f53303f78e0096b1a5ce98fc0ee80912d1334 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 17 Oct 2001 19:38:08 +0000 Subject: [PATCH] just comments --- source/mircoders/servlet/ServletModuleOpenIndy.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/source/mircoders/servlet/ServletModuleOpenIndy.java b/source/mircoders/servlet/ServletModuleOpenIndy.java index 6bd741df..ad77a2e5 100755 --- a/source/mircoders/servlet/ServletModuleOpenIndy.java +++ b/source/mircoders/servlet/ServletModuleOpenIndy.java @@ -220,6 +220,12 @@ public class ServletModuleOpenIndy extends ServletModule theLog.printDebugInfo("id: "+cid); //insert was not successfull if(cid==null){ + //How do we know that it was not succesful cause of a + //dupe, what if it failed cause of "No space left on device"? + //Or is there something I am missing? Wouldn't it be better + //to have an explicit dupe check and then insert? I have no + //idea what I am talking about. this comment is in case + //I forget to explicitely ask. -mh deliver(req, res, mergeData, postingFormDupeTemplate); } @@ -239,12 +245,13 @@ public class ServletModuleOpenIndy extends ServletModule for(Iterator it = mp.requestList.iterator(); it.hasNext();){ MpRequest mpReq = (MpRequest)it.next(); String fileName = mpReq.getFilename(); + //This is just a temporary way to get the content-type via //the .extension , we need to use a magic method, by looking - //at the header (first few bytes) of the file. -mh - //the Oreilly method sucks cause it rely's on the what + //at the header (first few bytes) of the file. + //the Oreilly method sucks cause it relies on the //content-type the client browser sends and that's - //too often application-octet stream. + //too often application-octet stream. -mh String contentType = FileUtil.guessContentTypeFromName(fileName); HashMap mediaValues = new HashMap(); @@ -253,7 +260,7 @@ public class ServletModuleOpenIndy extends ServletModule //The map file should be Mir/content-types.properties, it's the //default Sun Java file+ some entries that it did not have. //so if you support a new media type you have to make sure that - //it is in this file + //it is in this file -mh if ((contentType==null) || (contentType=="application/octet-stream")) { throw new ServletModuleException("ModuleException: One or more files of unrecognized types"); } @@ -308,8 +315,8 @@ public class ServletModuleOpenIndy extends ServletModule //save and store the media data/metadata mediaHandler.set(mpReq.getMedia(), mediaEnt,mediaTypesList.elementAt(0)); - //were done with mpReq at this point, dereference it. as it contains - //mucho mem. -mh 01.10.2001 + //were done with mpReq at this point, dereference it. + //as it contains mucho mem. -mh 01.10.2001 mpReq=null; if(mediaId!=null){ -- 2.11.0