/**
* FIXME: this needs to be configurable based on storage type, and availability of proxy module
- * ... could be a different type since we need methods to modify the storage metadata
+ * ... could be a different type since we need methods to modify the storage metadata
+ *
* @plexus.requirement role-hint="maven2"
*/
private MetadataResolver storageResolver;
return metadataRepository.getProject( repoId, namespace, projectId );
}
- public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
+ public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
+ String projectVersion )
throws MetadataResolverException
{
- ProjectVersionMetadata metadata = metadataRepository.getProjectVersion( repoId, namespace, projectId, projectVersion );
+ ProjectVersionMetadata metadata =
+ metadataRepository.getProjectVersion( repoId, namespace, projectId, projectVersion );
// TODO: do we want to detect changes as well by comparing timestamps? isProjectVersionNewerThan(updated)
// in such cases we might also remove/update stale metadata, including adjusting plugin-based facets
if ( metadata == null )
{
metadata = storageResolver.getProjectVersion( repoId, namespace, projectId, projectVersion );
- metadataRepository.updateProjectVersion( repoId, namespace, projectId, metadata );
+ if ( metadata != null )
+ {
+ metadataRepository.updateProjectVersion( repoId, namespace, projectId, metadata );
+ }
}
return metadata;
}
- public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion )
+ public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
+ String projectVersion )
{
// TODO: intercept
return metadataRepository.getArtifactVersions( repoId, namespace, projectId, projectVersion );
return properties;
}
- public ProjectMetadata getProject( String repoId, String groupId, String projectId )
+ public ProjectMetadata getProject( String repoId, String namespace, String projectId )
{
- File directory = new File( this.directory, repoId + "/" + projectId );
+ File directory = new File( this.directory, repoId + "/" + namespace + "/" + projectId );
Properties properties = readProperties( directory );
return project;
}
- public ProjectVersionMetadata getProjectVersion( String repoId, String groupId, String projectId,
+ public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
String projectVersion )
{
- File directory = new File( this.directory, repoId + "/" + projectId + "/" + projectVersion );
+ File directory = new File( this.directory, repoId + "/" + namespace + "/" + projectId + "/" + projectVersion );
Properties properties = readProperties( directory );
-
- ProjectVersionMetadata versionMetadata = new ProjectVersionMetadata();
- versionMetadata.setId( properties.getProperty( "id" ) );
+ String id = properties.getProperty( "id" );
+ ProjectVersionMetadata versionMetadata = null;
+ if ( id != null )
+ {
+ versionMetadata = new ProjectVersionMetadata();
+ versionMetadata.setId( id );
+ }
return versionMetadata;
}
public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
String projectVersion )
{
- File directory = new File( this.directory, repoId + "/" + projectId + "/" + projectVersion );
+ File directory = new File( this.directory, repoId + "/" + namespace + "/" + projectId + "/" + projectVersion );
Properties properties = readProperties( directory );