1 package org.apache.archiva.configuration;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
23 * Class LegacyArtifactPath.
25 * @version $Revision$ $Date$
27 @SuppressWarnings( "all" )
28 public class LegacyArtifactPath
29 implements java.io.Serializable
32 //--------------------------/
33 //- Class/Member Variables -/
34 //--------------------------/
45 * The artifact reference, as " [groupId] :
46 * [artifactId] : [version] : [classifier] : [type] ".
49 private String artifact;
57 * Get the artifact reference, as " [groupId] : [artifactId] :
58 * [version] : [classifier] : [type] ".
62 public String getArtifact()
65 } //-- String getArtifact()
68 * Get the legacy path.
72 public String getPath()
75 } //-- String getPath()
78 * Set the artifact reference, as " [groupId] : [artifactId] :
79 * [version] : [classifier] : [type] ".
83 public void setArtifact( String artifact )
85 this.artifact = artifact;
86 } //-- void setArtifact( String )
89 * Set the legacy path.
93 public void setPath( String path )
96 } //-- void setPath( String )
99 public boolean match( String path )
101 return path.equals( this.path );
104 public String getGroupId()
106 return artifact.split( ":" )[0];
109 public String getArtifactId()
111 return artifact.split( ":" )[1];
114 public String getVersion()
116 return artifact.split( ":" )[2];
119 public String getClassifier()
121 String classifier = artifact.split( ":" )[3];
122 return classifier.length() > 0 ? classifier : null;
125 public String getType()
127 return artifact.split( ":" )[4];
131 public boolean equals( Object o )
137 if ( o == null || getClass() != o.getClass() )
142 LegacyArtifactPath that = (LegacyArtifactPath) o;
144 if ( path != null ? !path.equals( that.path ) : that.path != null )
153 public int hashCode()
155 return path != null ? 37 + path.hashCode() : 0;