cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/reading DirectoryZipArchiver.java ImageReader.java
Date Tue, 11 Jun 2002 23:54:54 GMT
vgritsenko    2002/06/11 16:54:54

  Modified:    src/scratchpad/src/org/apache/cocoon/reading
                        DirectoryZipArchiver.java ImageReader.java
  Log:
  Use ObjectModelHelper instead of deprecated Constants
  
  Revision  Changes    Path
  1.4       +14 -29    xml-cocoon2/src/scratchpad/src/org/apache/cocoon/reading/DirectoryZipArchiver.java
  
  Index: DirectoryZipArchiver.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/reading/DirectoryZipArchiver.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DirectoryZipArchiver.java	22 Feb 2002 06:58:03 -0000	1.3
  +++ DirectoryZipArchiver.java	11 Jun 2002 23:54:54 -0000	1.4
  @@ -50,36 +50,11 @@
   */
   package org.apache.cocoon.reading;
   
  -import java.io.InputStream;
  -import java.io.BufferedInputStream;
  -import java.io.FileInputStream;
  -import java.io.FileOutputStream;
  -import java.io.File;
  -import java.io.OutputStream;
  -import java.io.IOException;
  -
  -import java.net.URL;
  -
  -import java.util.Map;
  -import java.util.Date;
  -
  -import java.util.zip.ZipEntry;
  -import java.util.zip.ZipOutputStream;
  -
  -import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.parameters.Parameters;
   
  -import org.apache.cocoon.Constants;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.ResourceNotFoundException;
  -import org.apache.cocoon.caching.CacheValidity;
  -import org.apache.cocoon.caching.Cacheable;
  -import org.apache.cocoon.caching.TimeStampCacheValidity;
  -import org.apache.cocoon.util.HashUtil;
  -import org.apache.cocoon.environment.Context;
  +import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Response;
   import org.apache.cocoon.environment.Source;
  @@ -87,6 +62,16 @@
   
   import org.xml.sax.SAXException;
   
  +import java.io.File;
  +import java.io.FileInputStream;
  +import java.io.IOException;
  +import java.io.InputStream;
  +import java.io.OutputStream;
  +import java.net.URL;
  +import java.util.Map;
  +import java.util.zip.ZipEntry;
  +import java.util.zip.ZipOutputStream;
  +
   /**
    * The <code>DirectoryZipArchiver</code> component creates a compressed zip
    * archive of the files contained in the directory passed with 'src'.
  @@ -110,8 +95,8 @@
       public void setup(SourceResolver resolver, Map objectModel, String src, Parameters
par)
           throws ProcessingException, SAXException, IOException {
           super.setup(resolver, objectModel, src, par);
  -        this.request = (Request) objectModel.get(Constants.REQUEST_OBJECT);
  -        this.response = (Response) objectModel.get(Constants.RESPONSE_OBJECT);
  +        this.request = ObjectModelHelper.getRequest(objectModel);
  +        this.response = ObjectModelHelper.getResponse(objectModel);
   
           this.inputSource = this.resolver.resolve(super.source);
   
  
  
  
  1.4       +22 -34    xml-cocoon2/src/scratchpad/src/org/apache/cocoon/reading/ImageReader.java
  
  Index: ImageReader.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/reading/ImageReader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ImageReader.java	22 Feb 2002 06:58:03 -0000	1.3
  +++ ImageReader.java	11 Jun 2002 23:54:54 -0000	1.4
  @@ -50,52 +50,40 @@
   */
   package org.apache.cocoon.reading;
   
  -import java.io.InputStream;
  -import java.io.BufferedInputStream;
  -import java.io.FileInputStream;
  -import java.io.FileOutputStream;
  -import java.io.File;
  -import java.io.OutputStream;
  -import java.io.ByteArrayOutputStream;
  -import java.io.IOException;
  -
  -import java.util.Map;
  -import java.util.Date;
  -
  -import java.awt.geom.AffineTransform;
  -
  -import java.awt.image.Raster;
  -import java.awt.image.WritableRaster;
  -import java.awt.image.AffineTransformOp;
  -
  -import com.sun.image.codec.jpeg.JPEGCodec;
  -import com.sun.image.codec.jpeg.JPEGImageEncoder;
  -import com.sun.image.codec.jpeg.JPEGImageDecoder;
  -import com.sun.image.codec.jpeg.JPEGDecodeParam;
  -import com.sun.image.codec.jpeg.JPEGEncodeParam;
  -import com.sun.image.codec.jpeg.ImageFormatException;
  -
  -import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.parameters.Parameters;
   
  -import org.apache.cocoon.Constants;
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.ResourceNotFoundException;
   import org.apache.cocoon.caching.CacheValidity;
   import org.apache.cocoon.caching.Cacheable;
   import org.apache.cocoon.caching.TimeStampCacheValidity;
  -import org.apache.cocoon.util.HashUtil;
   import org.apache.cocoon.environment.Context;
  +import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Response;
   import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.environment.SourceResolver;
  +import org.apache.cocoon.util.HashUtil;
   
  +import com.sun.image.codec.jpeg.ImageFormatException;
  +import com.sun.image.codec.jpeg.JPEGCodec;
  +import com.sun.image.codec.jpeg.JPEGDecodeParam;
  +import com.sun.image.codec.jpeg.JPEGImageDecoder;
  +import com.sun.image.codec.jpeg.JPEGImageEncoder;
   import org.xml.sax.SAXException;
   
  +import java.awt.geom.AffineTransform;
  +import java.awt.image.AffineTransformOp;
  +import java.awt.image.Raster;
  +import java.awt.image.WritableRaster;
  +import java.io.ByteArrayOutputStream;
  +import java.io.IOException;
  +import java.io.InputStream;
  +import java.io.OutputStream;
  +import java.util.Date;
  +import java.util.Map;
  +
   /**
    * The <code>ImageReader</code> component is used to serve binary image data
    * in a sitemap pipeline. It makes use of HTTP Headers to determine if
  @@ -137,8 +125,8 @@
       public void setup(SourceResolver resolver, Map objectModel, String src, Parameters
par)
           throws ProcessingException, SAXException, IOException {
           super.setup(resolver, objectModel, src, par);
  -        this.request = (Request) objectModel.get(Constants.REQUEST_OBJECT);
  -        this.response = (Response) objectModel.get(Constants.RESPONSE_OBJECT);
  +        this.request = ObjectModelHelper.getRequest(objectModel);
  +        this.response = ObjectModelHelper.getResponse(objectModel);
           this.width = par.getParameterAsInteger("width", 0);
           this.height = par.getParameterAsInteger("height", 0);
           this.expireTime = par.getParameterAsInteger("expire-time", -1);
  @@ -285,7 +273,7 @@
        * Returns the mime-type of the resource in process.
        */
       public String getMimeType() {
  -        Context ctx = (Context) objectModel.get(Constants.CONTEXT_OBJECT);
  +        Context ctx = ObjectModelHelper.getContext(objectModel);
           return (ctx != null) ? ctx.getMimeType(this.source) : null;
       }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message