From: mh Date: Wed, 27 Nov 2002 07:10:35 +0000 (+0000) Subject: remove now unused showicon and showimage methods (replaced by getMedia, getIcon in... X-Git-Tag: MIR_1_0_0_RC1~10 X-Git-Url: http://erislabs.net/gitweb/?p=mir.git;a=commitdiff_plain;h=81d7fb456efadc52ce8d2596416392aa5c84f1da remove now unused showicon and showimage methods (replaced by getMedia, getIcon in ServletModuleUploadedMedia) --- diff --git a/source/mircoders/servlet/ServletModuleImages.java b/source/mircoders/servlet/ServletModuleImages.java index 7044dbe6..92619af9 100755 --- a/source/mircoders/servlet/ServletModuleImages.java +++ b/source/mircoders/servlet/ServletModuleImages.java @@ -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."); - } }