cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giac...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/environment/commandline FileSavingEnvironment.java LinkSamplingEnvironment.java
Date Sat, 30 Dec 2000 21:36:48 GMT
giacomo     00/12/30 13:36:47

  Modified:    src/org/apache/cocoon/environment/commandline Tag:
                        xml-cocoon2 FileSavingEnvironment.java
                        LinkSamplingEnvironment.java
  Log:
  Added loggin to commandline environments
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +7 -1      xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/FileSavingEnvironment.java
  
  Index: FileSavingEnvironment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/FileSavingEnvironment.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- FileSavingEnvironment.java	2000/10/06 21:25:28	1.1.2.7
  +++ FileSavingEnvironment.java	2000/12/30 21:36:46	1.1.2.8
  @@ -20,18 +20,24 @@
   import org.apache.cocoon.Cocoon;
   import org.apache.cocoon.environment.AbstractEnvironment;
   
  +import org.apache.log.Logger;
  +import org.apache.log.LogKit;
  +
   /**
    * This environment is used to save the requested file to disk.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/10/06 21:25:28 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/12/30 21:36:46 $
    */
   
   public class FileSavingEnvironment extends AbstractCommandLineEnvironment {
   
  +    private Logger log = LogKit.getLoggerFor("cocoon");
  +
       public FileSavingEnvironment(String uri, File context, Map attributes, Map parameters,
Map links, OutputStream stream)
       throws MalformedURLException {
           super(uri, null, context, stream);
  +        log.debug("FileSavingEnvironment: uri=" + uri);
           this.objectModel.put(Cocoon.LINK_OBJECT, links);
           this.objectModel.put(Cocoon.REQUEST_OBJECT, new CommandLineRequest(null, uri, null,
attributes, parameters));
           this.objectModel.put(Cocoon.RESPONSE_OBJECT, new CommandLineResponse());
  
  
  
  1.1.2.8   +17 -10    xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/LinkSamplingEnvironment.java
  
  Index: LinkSamplingEnvironment.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/environment/commandline/Attic/LinkSamplingEnvironment.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- LinkSamplingEnvironment.java	2000/10/06 21:25:28	1.1.2.7
  +++ LinkSamplingEnvironment.java	2000/12/30 21:36:46	1.1.2.8
  @@ -29,43 +29,50 @@
   import org.apache.cocoon.Cocoon;
   import org.apache.cocoon.environment.AbstractEnvironment;
   
  +import org.apache.log.Logger;
  +import org.apache.log.LogKit;
  +
  +
   /**
    * This environment is sample the links of the resource.
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2000/10/06 21:25:28 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2000/12/30 21:36:46 $
    */
   
   public class LinkSamplingEnvironment extends AbstractCommandLineEnvironment {
   
  +    private Logger log = LogKit.getLoggerFor("cocoon");
  +
       private boolean skip = false;
  -    
  -    public LinkSamplingEnvironment(String uri, File contextFile, Map attributes, Map parameters)

  +
  +    public LinkSamplingEnvironment(String uri, File contextFile, Map attributes, Map parameters)
       throws MalformedURLException, IOException {
           super(uri, Cocoon.LINK_VIEW, contextFile, new ByteArrayOutputStream());
  +        log.debug("LinkSamplingEnvironment: uri=" + uri);
           this.objectModel.put(Cocoon.REQUEST_OBJECT, new CommandLineRequest(null, uri, null,
attributes, parameters));
           this.objectModel.put(Cocoon.RESPONSE_OBJECT, new CommandLineResponse());
       }
   
  -    /** 
  -     * Set the ContentType 
  -     */ 
  +    /**
  +     * Set the ContentType
  +     */
       public void setContentType(String contentType) {
           if (!Cocoon.LINK_CONTENT_TYPE.equals(contentType)) {
               this.skip = true;
           }
       }
  - 
  -    /** 
  +
  +    /**
        * Indicates if other links are present.
  -     */ 
  +     */
       public Collection getLinks() throws IOException {
           ArrayList list = new ArrayList();
           if (!skip) {
               BufferedReader buffer = new BufferedReader(
                   new InputStreamReader(
                       new ByteArrayInputStream(
  -                        ((ByteArrayOutputStream) stream).toByteArray()
  +                        ((ByteArrayOutputStream) super.stream).toByteArray()
                       )
                   )
               );
  
  
  

Mime
View raw message