Removing repository from constructor, Adding model as constructor option.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches/archiva-jpox-database-refactor@526880 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joakim Erdfelt 2007-04-09 19:13:12 +00:00
parent 6ee23e63a9
commit ede71ae385
1 changed files with 8 additions and 10 deletions

View File

@ -38,12 +38,7 @@ public class ArchivaArtifact
private boolean snapshot = false;
public ArchivaArtifact( String groupId, String artifactId, String version, String classifier, String type )
{
this( null, groupId, artifactId, version, classifier, type );
}
public ArchivaArtifact( ArchivaRepository repository, String groupId, String artifactId, String version,
public ArchivaArtifact( String groupId, String artifactId, String version,
String classifier, String type )
{
if ( empty( groupId ) )
@ -71,10 +66,6 @@ public class ArchivaArtifact
model.setGroupId( groupId );
model.setArtifactId( artifactId );
model.setVersion( version );
if ( repository != null )
{
model.setRepositoryId( repository.getId() );
}
model.setClassifier( StringUtils.defaultString( classifier ) );
model.setType( type );
@ -82,6 +73,13 @@ public class ArchivaArtifact
this.baseVersion = VersionUtil.getBaseVersion( version );
}
public ArchivaArtifact( ArchivaArtifactModel artifactModel )
{
this.model = artifactModel;
this.snapshot = VersionUtil.isSnapshot( model.getVersion() );
this.baseVersion = VersionUtil.getBaseVersion( model.getVersion() );
}
public ArchivaArtifactModel getModel()
{
return model;