You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Stephen McConnell <mc...@apache.org> on 2003/11/12 07:24:23 UTC

Re: cvs commit: avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl DefaultFileRepository.java


akarasulu@apache.org wrote:

>  +     public URL getArtifact(
>  +       final String artifact, final String version, final String type )
>  +       throws RepositoryException
>  +     {
>  +         int n = artifact.indexOf( SEPERATOR ) ;
>  +         
>  +         if( n < 1 )
>  +         {
>  +             final String error = "Invalid artifact name: " + artifact ;
>  +             throw new RepositoryException( error ) ;
>  +         }
>  +         
>  +         final String group = artifact.substring( 0, n ) ;
>  +         final String name = artifact.substring( n + 1 ) ; 
>  +         return getArtifact( group, name, version, type ) ;
>  +     }
>

Just thinking - if n < 1, then assign the artifact value to both group 
and name.

Stephen.




-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


RE: cvs commit: avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl DefaultFileRepository.java

Posted by Alex Karasulu <ao...@bellsouth.net>.
Will do!

> -----Original Message-----
> From: Stephen McConnell [mailto:mcconnell@apache.org]
> Sent: Wednesday, November 12, 2003 1:24 AM
> To: Avalon Developers List
> Subject: Re: cvs commit: avalon-
> sandbox/repository/impl/src/java/org/apache/avalon/repository/impl
> DefaultFileRepository.java
> 
> 
> 
> akarasulu@apache.org wrote:
> 
> >  +     public URL getArtifact(
> >  +       final String artifact, final String version, final String type
> )
> >  +       throws RepositoryException
> >  +     {
> >  +         int n = artifact.indexOf( SEPERATOR ) ;
> >  +
> >  +         if( n < 1 )
> >  +         {
> >  +             final String error = "Invalid artifact name: " + artifact
> ;
> >  +             throw new RepositoryException( error ) ;
> >  +         }
> >  +
> >  +         final String group = artifact.substring( 0, n ) ;
> >  +         final String name = artifact.substring( n + 1 ) ;
> >  +         return getArtifact( group, name, version, type ) ;
> >  +     }
> >
> 
> Just thinking - if n < 1, then assign the artifact value to both group
> and name.
> 
> Stephen.
> 
> 
> 
> 
> --
> 
> Stephen J. McConnell
> mailto:mcconnell@apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> For additional commands, e-mail: dev-help@avalon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org