private Collection<Gav> getGavs( String path, Collection<String> items ) { if ( !path.endsWith( "/" ) ) { path = path + "/"; } M2GavCalculator calc = new M2GavCalculator(); List<Gav> gavs = new ArrayList<Gav>(); Collections.sort( (ArrayList<String>) items ); for ( String item : items ) { final Gav gav = calc.pathToGav( path + item ); if ( gav != null ) { gavs.add( gav ); } } return gavs; }
return getSnapshotGav( s, vEndPos, groupId, artifactId, version, fileName, checksum, signature, checksumType, signatureType ); return getReleaseGav( s, vEndPos, groupId, artifactId, version, fileName, checksum, signature, checksumType, signatureType );
public String gavToPath( Gav gav ) { StringBuilder path = new StringBuilder( "/" ); path.append( gav.getGroupId().replaceAll( "(?m)(.)\\.", "$1/" ) ); // replace all '.' except the first char path.append( "/" ); path.append( gav.getArtifactId() ); path.append( "/" ); path.append( gav.getBaseVersion() ); path.append( "/" ); path.append( calculateArtifactName( gav ) ); return path.toString(); }