set repository id in ArtifactUpdateDatabaseConsumer only when repository id is null

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@747306 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Maria Odea B. Ching 2009-02-24 08:35:43 +00:00
parent a0da36af3c
commit a9a04ebb7d
1 changed files with 6 additions and 3 deletions

View File

@ -57,7 +57,7 @@ import java.util.List;
public class ArtifactUpdateDatabaseConsumer public class ArtifactUpdateDatabaseConsumer
extends AbstractMonitoredConsumer extends AbstractMonitoredConsumer
implements KnownRepositoryContentConsumer, RegistryListener, Initializable implements KnownRepositoryContentConsumer, RegistryListener, Initializable
{ {
private static final String TYPE_NOT_ARTIFACT = "file-not-artifact"; private static final String TYPE_NOT_ARTIFACT = "file-not-artifact";
private static final String DB_ERROR = "db-error"; private static final String DB_ERROR = "db-error";
@ -161,10 +161,13 @@ public class ArtifactUpdateDatabaseConsumer
{ {
return; return;
} }
try try
{ {
artifact.getModel().setRepositoryId( this.repository.getId() ); if( artifact.getModel().getRepositoryId() == null )
{
artifact.getModel().setRepositoryId( this.repository.getId() );
}
// Calculate the hashcodes. // Calculate the hashcodes.
File artifactFile = new File( this.repositoryDir, path ); File artifactFile = new File( this.repositoryDir, path );