maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout DefaultRepositoryLayout.java LegacyRepositoryLayout.java
Date Mon, 11 Apr 2005 01:24:43 GMT
brett       2005/04/10 18:24:43

  Modified:    maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout
                        DefaultRepositoryLayout.java
                        LegacyRepositoryLayout.java
  Log:
  allow an empty extension
  
  Revision  Changes    Path
  1.9       +6 -3      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java
  
  Index: DefaultRepositoryLayout.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/DefaultRepositoryLayout.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultRepositoryLayout.java	1 Apr 2005 04:09:36 -0000	1.8
  +++ DefaultRepositoryLayout.java	11 Apr 2005 01:24:43 -0000	1.9
  @@ -42,8 +42,8 @@
           }
           catch ( ArtifactHandlerNotFoundException e )
           {
  -            throw new ArtifactPathFormatException( "Cannot find ArtifactHandler for artifact:
\'" + artifact.getId()
  -                + "\'.", e );
  +            throw new ArtifactPathFormatException( "Cannot find ArtifactHandler for artifact:
\'" + artifact.getId() +
  +                                                   "\'.", e );
           }
   
           StringBuffer path = new StringBuffer();
  @@ -58,7 +58,10 @@
               path.append( '-' ).append( artifact.getClassifier() );
           }
   
  -        path.append( '.' ).append( artifactHandler.extension() );
  +        if ( artifactHandler.extension() != null && artifactHandler.extension().length()
> 0 )
  +        {
  +            path.append( '.' ).append( artifactHandler.extension() );
  +        }
   
           return path.toString();
       }
  
  
  
  1.9       +19 -16    maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/LegacyRepositoryLayout.java
  
  Index: LegacyRepositoryLayout.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/repository/layout/LegacyRepositoryLayout.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- LegacyRepositoryLayout.java	1 Apr 2005 04:09:37 -0000	1.8
  +++ LegacyRepositoryLayout.java	11 Apr 2005 01:24:43 -0000	1.9
  @@ -42,22 +42,25 @@
           }
           catch ( ArtifactHandlerNotFoundException e )
           {
  -            throw new ArtifactPathFormatException( "Cannot find ArtifactHandler for artifact:
\'" + artifact.getId()
  -                + "\'.", e );
  +            throw new ArtifactPathFormatException( "Cannot find ArtifactHandler for artifact:
\'" + artifact.getId() +
  +                                                   "\'.", e );
           }
  -        
  +
           StringBuffer path = new StringBuffer();
  -        
  -        path.append(artifact.getGroupId()).append('/');
  -        path.append(artifactHandler.directory()).append('/');
  -        path.append(artifact.getArtifactId()).append('-').append(artifact.getVersion());
  -        
  +
  +        path.append( artifact.getGroupId() ).append( '/' );
  +        path.append( artifactHandler.directory() ).append( '/' );
  +        path.append( artifact.getArtifactId() ).append( '-' ).append( artifact.getVersion()
);
  +
           if ( artifact.hasClassifier() )
           {
  -            path.append('-').append(artifact.getClassifier());
  +            path.append( '-' ).append( artifact.getClassifier() );
  +        }
  +
  +        if ( artifactHandler.extension() != null && artifactHandler.extension().length()
> 0 )
  +        {
  +            path.append( '.' ).append( artifactHandler.extension() );
           }
  -        
  -        path.append('.').append(artifactHandler.extension());
   
           return path.toString();
       }
  @@ -66,12 +69,12 @@
           throws ArtifactPathFormatException
       {
           Artifact artifact = metadata.getArtifact();
  -        
  +
           StringBuffer path = new StringBuffer();
  -        
  -        path.append(artifact.getGroupId()).append("/poms/");
  -        path.append(metadata.getFilename());
  -        
  +
  +        path.append( artifact.getGroupId() ).append( "/poms/" );
  +        path.append( metadata.getFilename() );
  +
           return path.toString();
       }
   
  
  
  

Mime
View raw message