cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl RepositorySource.java
Date Mon, 03 Nov 2003 08:40:15 GMT
unico       2003/11/03 00:40:15

  Modified:    src/blocks/repository/java/org/apache/cocoon/components/source/impl
                        RepositorySource.java
  Log:
  fix traversal methods
  
  Revision  Changes    Path
  1.2       +15 -3     cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/RepositorySource.java
  
  Index: RepositorySource.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/RepositorySource.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RepositorySource.java	28 Oct 2003 15:03:59 -0000	1.1
  +++ RepositorySource.java	3 Nov 2003 08:40:15 -0000	1.2
  @@ -55,6 +55,7 @@
   import java.util.ArrayList;
   import java.util.Arrays;
   import java.util.Collection;
  +import java.util.Iterator;
   import java.util.List;
   
   import org.apache.avalon.excalibur.pool.Recyclable;
  @@ -232,14 +233,24 @@
           m_delegate.refresh();
       }
       
  +    
       // ---------------------------------------------------- ModifiableTraversableSource
       
       public Source getChild(String name) throws SourceException {
  -        return m_delegate.getChild(name);
  +        return new RepositorySource((ModifiableTraversableSource) m_delegate.getChild(name),
  +            m_manager,getLogger());
       }
   
       public Collection getChildren() throws SourceException {
  -        return m_delegate.getChildren();
  +    	Collection result = new ArrayList();
  +		Iterator iter = m_delegate.getChildren().iterator();
  +    	while(iter.hasNext()) {
  +    		result.add(new RepositorySource(
  +    		    (ModifiableTraversableSource) iter.next(),
  +    		    m_manager,
  +    		    getLogger()));
  +    	}
  +        return result;
       }
   
       public String getName() {
  @@ -247,7 +258,8 @@
       }
   
       public Source getParent() throws SourceException {
  -        return m_delegate.getParent();
  +        return new RepositorySource((ModifiableTraversableSource) m_delegate.getParent(),

  +        	m_manager, getLogger());
       }
   
       public boolean isCollection() {
  
  
  

Mime
View raw message