cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gian...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl RepositorySource.java RepositorySourceFactory.java
Date Mon, 16 Feb 2004 16:03:09 GMT
gianugo     2004/02/16 08:03:09

  Modified:    src/blocks/repository/java/org/apache/cocoon/components/source/impl
                        RepositorySource.java RepositorySourceFactory.java
  Log:
  Consistency: getURI() and getScheme() should return the "piggybacked" (repository: prefixed)
source version
  
  Revision  Changes    Path
  1.4       +15 -6     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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RepositorySource.java	13 Feb 2004 13:43:31 -0000	1.3
  +++ RepositorySource.java	16 Feb 2004 16:03:09 -0000	1.4
  @@ -90,7 +90,9 @@
    */
   public class RepositorySource extends AbstractLogEnabled 
   implements Source, ModifiableTraversableSource, InspectableSource {
  -    
  +
  +    // the original source prefix
  +    final String m_prefix;
       // the wrapped source
       final ModifiableTraversableSource m_delegate;
       private final ServiceManager m_manager;
  @@ -99,10 +101,12 @@
       // ---------------------------------------------------- Lifecycle
       
       public RepositorySource(
  +        final String prefix,
           final ModifiableTraversableSource delegate, 
           final ServiceManager manager, 
           final Logger logger) throws SourceException {
           
  +        m_prefix = prefix;
           m_delegate = delegate;
           m_manager = manager;
           enableLogging(logger);
  @@ -201,11 +205,11 @@
       }
       
       public String getScheme() {
  -        return m_delegate.getScheme();
  +        return m_prefix + ":" + m_delegate.getScheme();
       }
       
       public String getURI() {
  -        return m_delegate.getURI();
  +        return m_prefix + ":" + m_delegate.getURI();
       }
       
       public SourceValidity getValidity() {
  @@ -230,7 +234,9 @@
       // ---------------------------------------------------- ModifiableTraversableSource
       
       public Source getChild(String name) throws SourceException {
  -        return new RepositorySource((ModifiableTraversableSource) m_delegate.getChild(name),
  +        return new RepositorySource(
  +            m_prefix,  
  +            (ModifiableTraversableSource) m_delegate.getChild(name),
               m_manager,getLogger());
       }
   
  @@ -239,6 +245,7 @@
   		Iterator iter = m_delegate.getChildren().iterator();
       	while(iter.hasNext()) {
       		result.add(new RepositorySource(
  +            m_prefix,
       		    (ModifiableTraversableSource) iter.next(),
       		    m_manager,
       		    getLogger()));
  @@ -251,8 +258,10 @@
       }
   
       public Source getParent() throws SourceException {
  -        return new RepositorySource((ModifiableTraversableSource) m_delegate.getParent(),

  -        	m_manager, getLogger());
  +        return new RepositorySource(
  +            m_prefix,
  +            (ModifiableTraversableSource) m_delegate.getParent(), 
  +        	  m_manager, getLogger());
       }
   
       public boolean isCollection() {
  
  
  
  1.3       +1 -0      cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/RepositorySourceFactory.java
  
  Index: RepositorySourceFactory.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/repository/java/org/apache/cocoon/components/source/impl/RepositorySourceFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RepositorySourceFactory.java	13 Feb 2004 13:43:31 -0000	1.2
  +++ RepositorySourceFactory.java	16 Feb 2004 16:03:09 -0000	1.3
  @@ -112,6 +112,7 @@
               throw new SourceException(message);
           }
           return new RepositorySource(
  +            m_name,    
               (ModifiableTraversableSource) source, 
               m_manager,
               getLogger());
  
  
  

Mime
View raw message