remove now unused showicon and showimage methods (replaced by getMedia, getIcon in...
authormh <mh>
Wed, 27 Nov 2002 07:10:35 +0000 (07:10 +0000)
committermh <mh>
Wed, 27 Nov 2002 07:10:35 +0000 (07:10 +0000)
source/mircoders/servlet/ServletModuleImages.java

index 7044dbe..92619af 100755 (executable)
@@ -60,8 +60,8 @@ import mircoders.producer.*;
  *  ServletModuleImages -
  *  liefert HTML fuer Images
  *
- *
- * @author RK
+ * @version $Id: ServletModuleImages.java,v 1.20.4.3 2002/11/27 07:10:35 mh Exp $
+ * @author RK, the mir-coders group
  */
 
 public class ServletModuleImages extends ServletModuleUploadedMedia
@@ -88,68 +88,5 @@ public class ServletModuleImages extends ServletModuleUploadedMedia
     }
   }
 
-  public void showimg(HttpServletRequest req, HttpServletResponse res)
-    throws ServletModuleException
-  {
-    String idParam = req.getParameter("id");
-    if (idParam!=null && !idParam.equals("")) {
-      try {
-        EntityImages entImage =(EntityImages)mainModule.getById(idParam);
-        ServletContext ctx =
-                    (ServletContext)MirConfig.getPropAsObject("ServletContext");
-        String fName = entImage.getId()+"."
-                      +entImage.getMediaType().getValue("name");
-        res.setContentType(ctx.getMimeType(fName));
-        ServletOutputStream out = res.getOutputStream(); // wichtig, dass vorher kein res.getwriter() gelaufen ist
-
-        InputStream in = entImage.getImage();
-        int read;
-        byte[] buf = new byte[8 * 1024];
-        while((read = in.read(buf)) != -1) {
-          out.write(buf, 0, read);
-        }
-        in.close();
-        out.close();
-      }
-
-      catch (IOException e) {throw new ServletModuleException(e.toString());}
-      catch (ModuleException e) {throw new ServletModuleException(e.toString());}
-      catch (Exception e) {throw new ServletModuleException(e.toString());}
-    }
-    else theLog.printDebugInfo("id nicht angeben.");
-    // darf keine exception werfen
-  }
-
-  public void showicon(HttpServletRequest req, HttpServletResponse res)
-    throws ServletModuleException
-  {
-    String idParam = req.getParameter("id");
-    if (idParam!=null && !idParam.equals("")) {
-      try {
-        EntityImages entImage =(EntityImages)mainModule.getById(idParam);
-        ServletContext ctx =
-                    (ServletContext)MirConfig.getPropAsObject("ServletContext");
-        String fName = entImage.getId()+"."
-                      +entImage.getMediaType().getValue("name");
-        res.setContentType(ctx.getMimeType(fName));
-        ServletOutputStream out = res.getOutputStream(); // wichtig, dass vorher kein res.getwriter() gelaufen ist
-
-        InputStream in = entImage.getIcon();
-        int read;
-        byte[] buf = new byte[8 * 1024];
-        while((read = in.read(buf)) != -1) {
-          out.write(buf, 0, read);
-        }
-        in.close();
-        //out.write(outbytes);
-        out.close();
-      }
-
-      catch (IOException e) {throw new ServletModuleException(e.toString());}
-      catch (ModuleException e) {throw new ServletModuleException(e.toString());}
-      catch (Exception e) {throw new ServletModuleException(e.toString());}
-    }
-    else throw new ServletModuleException("id nicht angeben.");
-  }
 }