clean up artifact handler a little - fields are all final

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163645 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-03-22 06:51:16 +00:00
parent 7b1f2de259
commit f07d86f311
2 changed files with 25 additions and 22 deletions

View File

@ -32,19 +32,19 @@ public class DefaultArtifact
// These are the only things i need to specify // These are the only things i need to specify
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
private String groupId; private final String groupId;
private String artifactId; private final String artifactId;
private String version; private final String version;
private String type; private final String type;
private String classifier; private final String classifier;
private String scope; private final String scope;
private String extension; private final String extension;
private String path; private String path;
@ -81,8 +81,15 @@ public class DefaultArtifact
this.classifier = classifier; this.classifier = classifier;
if ( extension == null )
{
this.extension = type;
}
else
{
this.extension = extension; this.extension = extension;
} }
}
public DefaultArtifact( String groupId, String artifactId, String version, String type ) public DefaultArtifact( String groupId, String artifactId, String version, String type )
{ {
@ -125,15 +132,10 @@ public class DefaultArtifact
} }
public String getExtension() public String getExtension()
{
if ( extension != null )
{ {
return extension; return extension;
} }
return type;
}
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// //
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------

View File

@ -1,11 +1,7 @@
package org.apache.maven.artifact.handler.manager; package org.apache.maven.artifact.handler.manager;
import org.apache.maven.artifact.handler.ArtifactHandler;
import java.util.Set;
/* /*
* Copyright 2001-2004 The Apache Software Foundation. * Copyright 2001-2005 The Apache Software Foundation.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -20,6 +16,10 @@ import java.util.Set;
* limitations under the License. * limitations under the License.
*/ */
import org.apache.maven.artifact.handler.ArtifactHandler;
import java.util.Set;
/** /**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a> * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$ * @version $Id$
@ -28,7 +28,8 @@ public interface ArtifactHandlerManager
{ {
String ROLE = ArtifactHandlerManager.class.getName(); String ROLE = ArtifactHandlerManager.class.getName();
ArtifactHandler getArtifactHandler( String type ) throws ArtifactHandlerNotFoundException; ArtifactHandler getArtifactHandler( String type )
throws ArtifactHandlerNotFoundException;
// String localRepositoryPath( Artifact artifact, ArtifactRepository localRepository ) // String localRepositoryPath( Artifact artifact, ArtifactRepository localRepository )
// throws ArtifactHandlerNotFoundException; // throws ArtifactHandlerNotFoundException;