public static String toKey( VersionedReference reference ) { StringBuffer key = new StringBuffer(); key.append( defaultString( reference.getGroupId() ) ).append( ":" ); key.append( defaultString( reference.getArtifactId() ) ).append( ":" ); key.append( defaultString( reference.getVersion() ) ).append( ":" ); return key.toString(); }
public String toMetadataPath( VersionedReference reference ) { StringBuffer path = new StringBuffer(); path.append( formatAsDirectory( reference.getGroupId() ) ).append( PATH_SEPARATOR ); path.append( reference.getArtifactId() ).append( PATH_SEPARATOR ); if ( reference.getVersion() != null ) { // add the version only if it is present path.append( VersionUtil.getBaseVersion( reference.getVersion() ) ).append( PATH_SEPARATOR ); } path.append( MAVEN_METADATA ); return path.toString(); }
public Set<String> getVersions( VersionedReference reference ) throws ContentNotFoundException File groupDir = new File( repository.getLocation(), reference.getGroupId() );
public void deleteVersion( VersionedReference reference ) throws ContentNotFoundException { File groupDir = new File( repository.getLocation(), reference.getGroupId() ); if ( !groupDir.exists() ) { throw new ContentNotFoundException( "Unable to get versions using a non-existant groupId directory: " + groupDir.getAbsolutePath() ); } if ( !groupDir.isDirectory() ) { throw new ContentNotFoundException( "Unable to get versions using a non-directory: " + groupDir.getAbsolutePath() ); } // First gather up the versions found as artifacts in the managed repository. File typeDirs[] = groupDir.listFiles(); for ( File typeDir : typeDirs ) { if ( !typeDir.isDirectory() ) { // Skip it, we only care about directories. continue; } if ( !typeDir.getName().endsWith( "s" ) ) { // Skip it, we only care about directories that end in "s". } deleteVersions( typeDir, reference ); } }
public DependencyGraph createGraph( VersionedReference versionedProjectReference ) { String groupId = versionedProjectReference.getGroupId(); String artifactId = versionedProjectReference.getArtifactId(); String version = versionedProjectReference.getVersion(); DependencyGraph graph = new DependencyGraph( groupId, artifactId, version ); return graph; }
public static String toKey( VersionedReference ref ) { return toKey( ref.getGroupId(), ref.getArtifactId(), ref.getVersion() ); } }
public static VersionedReference clone( VersionedReference versionedReference ) { if ( versionedReference == null ) { return null; } VersionedReference cloned = new VersionedReference(); cloned.setGroupId( versionedReference.getGroupId() ); cloned.setArtifactId( versionedReference.getArtifactId() ); cloned.setVersion( versionedReference.getVersion() ); return cloned; }
if ( StringUtils.isNotBlank( relocation.getGroupId() ) ) refTO.setGroupId( relocation.getGroupId() );