akarasulu    2003/11/10 15:43:38

  Modified:    repository/api/src/java/org/apache/avalon/repository
                        InitialRepositoryFactory.java
  Log:
  
  
  Revision  Changes    Path
  1.3       +8 -45     
avalon-sandbox/repository/api/src/java/org/apache/avalon/repository/InitialRepositoryFactory.java
  
  Index: InitialRepositoryFactory.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/repository/api/src/java/org/apache/avalon/repository/InitialRepositoryFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InitialRepositoryFactory.java     10 Nov 2003 22:01:22 -0000      1.2
  +++ InitialRepositoryFactory.java     10 Nov 2003 23:43:38 -0000      1.3
  @@ -173,46 +173,9 @@
            * Build the url to access the properties of the implementation artifact
            * which is default mechanism dependent.
            */
  -        StringBuffer l_buf = new StringBuffer( s_apiBuild
  -            .getDefaultRepositories()[0] ) ;
  -        
  -        if ( '/' != l_buf.charAt( l_buf.length() - 1 ) )
  -        {
  -            l_buf.append( '/' ) ;
  -        }
  -        
  -        l_buf.append( a_implementation.getGroup() ).append( '/' ) ;
  -        l_buf.append( "propertiess/" ) ;
  -        l_buf.append( a_implementation.getName() ).append( '-' ) ;
  -        l_buf.append( a_implementation.getVersion() ) ;
  -        l_buf.append( ".jar.properties" ) ;
  -        
  -        System.out.println( "Accessing JarDescriptor at " + l_buf.toString() ) ;
  -        System.out.println( "user.dir = " + System.getProperty( "user.dir" ) ) ;
  -        
  -        /*
  -         * Access the attributes associated with the implementation artifact
  -         * because we need to get the implementation dependencies and download
  -         * them.
  -         */
  -        Attributes l_attrs = null ;
  -        try 
  -        {
  -            URL l_url = new URL( l_buf.toString() ) ;
  -            Properties l_props = RepositoryUtils.getProperties( l_url ) ;
  -            l_attrs = RepositoryUtils.getAsAttributes( l_props ) ;
  -        }
  -        catch ( MalformedURLException e )
  -        {
  -            throw new RepositoryException( "Incorrect repository url: " 
  -                + l_buf.toString(), e ) ;
  -        }
  -        catch ( IOException e )
  -        {
  -            throw new RepositoryException( "Failed to read attributes in "
  -                + l_buf.toString() + " for artifact " 
  -                + a_implementation.getSpecification(), e ) ;
  -        }
  +        Properties l_props = RepositoryUtils.getProperties( 
  +                s_apiBuild.getDefaultRepositories(), a_implementation ) ;
  +        Attributes l_attrs = RepositoryUtils.getAsAttributes( l_props ) ;
           
           /*
            * Download every dependency referenced by the implementation into the
  @@ -226,8 +189,7 @@
               {
                   String l_spec = ( String ) l_list.next() ;
                   JarDescriptor l_dep = new JarDescriptor( l_spec ) ;
  -                URL l_url = new URL( l_dep.getUrl( s_apiBuild
  -                        .getDefaultRepositories()[0] ) ) ;
  +                
                   StringBuffer l_target = new StringBuffer( l_tmpDir
                           .toString() ) ;
                   
  @@ -238,7 +200,8 @@
                   
                   l_target.append( l_dep.getRootRelativePath() ) ;
                   File l_targetFile = new File( l_target.toString() ) ;
  -                getTempFile( l_url.toExternalForm(), l_targetFile, true ) ;
  +                cacheArtifact( l_dep, s_apiBuild.getDefaultRepositories(),
  +                        l_targetFile, true ) ;
                   l_urlList.add( l_targetFile.toURL() ) ;
               }
           }
  @@ -390,7 +353,7 @@
               + "local cache file " + a_destFile.getAbsolutePath(), l_cause ) ;
       }
   
  -
  +    
       /**
        * Retrieve a remote file.  Returns true if the file was successfully
        * retrieved or if it is up to date (when the useTimestamp flag is set).
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to