*/
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArtifactReference;
import org.apache.maven.archiva.model.ProjectReference;
import org.apache.maven.archiva.model.VersionedReference;
public ManagedRepositoryConfiguration getRepository();
/**
- * Given a specific ProjectReference, return the list of available versions for
+ * Given a specific {@link ProjectReference}, return the list of available versions for
* that project reference.
*
* @param reference the project reference to work off of.
/**
* <p>
- * Given a specific VersionedReference, return the list of available versions for that
+ * Given a specific {@link VersionedReference}, return the list of available versions for that
* versioned reference.
* </p>
*
throws LayoutException;
/**
- * Given an ArtifactReference, return the file reference to the artifact.
+ * Given an {@link ArtifactReference}, return the file reference to the artifact.
*
* @param reference the artifact reference to use.
* @return the relative path to the artifact.
*/
public File toFile( ArtifactReference reference );
+
+ /**
+ * Given an {@link ArchivaArtifact}, return the file reference to the artifact.
+ *
+ * @param reference the archiva artifact to use.
+ * @return the relative path to the artifact.
+ */
+ public File toFile( ArchivaArtifact reference );
/**
- * Given a project reference, return the path to the metadata for
+ * Given a {@link ProjectReference}, return the path to the metadata for
* the project.
*
* @param reference the reference to use.
public String toMetadataPath( ProjectReference reference );
/**
- * Given a versioned reference, return the path to the metadata for
+ * Given a {@link VersionedReference}, return the path to the metadata for
* the specific version of the project.
*
* @param reference the reference to use.
public String toMetadataPath( VersionedReference reference );
/**
- * Given an ArtifactReference, return the relative path to the artifact.
+ * Given an {@link ArtifactReference}, return the relative path to the artifact.
*
* @param reference the artifact reference to use.
* @return the relative path to the artifact.
*/
public String toPath( ArtifactReference reference );
+
+ /**
+ * Given an {@link ArchivaArtifact}, return the relative path to the artifact.
+ *
+ * @param reference the archiva artifact to use.
+ * @return the relative path to the artifact.
+ */
+ public String toPath( ArchivaArtifact reference );
}
import org.apache.commons.lang.StringUtils;
import org.apache.maven.archiva.common.utils.VersionUtil;
+import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArtifactReference;
import org.apache.maven.archiva.model.ProjectReference;
import org.apache.maven.archiva.model.VersionedReference;
return path.toString();
}
+
+ public String toPath( ArchivaArtifact reference )
+ {
+ if ( reference == null )
+ {
+ throw new IllegalArgumentException( "ArchivaArtifact cannot be null" );
+ }
+
+ String baseVersion = VersionUtil.getBaseVersion( reference.getVersion() );
+ return toPath( reference.getGroupId(), reference.getArtifactId(), baseVersion, reference.getVersion(),
+ reference.getClassifier(), reference.getType() );
+ }
public String toPath( ArtifactReference reference )
{
*/
import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArtifactReference;
import org.apache.maven.archiva.repository.layout.LayoutException;
{
return LegacyPathParser.toArtifactReference( path );
}
+
+ public String toPath( ArchivaArtifact reference )
+ {
+ if ( reference == null )
+ {
+ throw new IllegalArgumentException( "Artifact reference cannot be null" );
+ }
+
+ return toPath( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(), reference
+ .getClassifier(), reference.getType() );
+ }
public String toPath( ArtifactReference reference )
{
import org.apache.maven.archiva.common.utils.PathUtil;
import org.apache.maven.archiva.configuration.FileTypes;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArtifactReference;
import org.apache.maven.archiva.model.ProjectReference;
import org.apache.maven.archiva.model.VersionedReference;
{
return new File( repository.getLocation(), toPath( reference ) );
}
+
+ public File toFile( ArchivaArtifact reference )
+ {
+ return new File( repository.getLocation(), toPath( reference ) );
+ }
/**
* Get the first Artifact found in the provided VersionedReference location.
import org.apache.maven.archiva.common.utils.PathUtil;
import org.apache.maven.archiva.configuration.FileTypes;
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.ArtifactReference;
import org.apache.maven.archiva.model.ProjectReference;
import org.apache.maven.archiva.model.VersionedReference;
return super.toArtifactReference( path );
}
+
+ public File toFile( ArchivaArtifact reference )
+ {
+ return new File( repository.getLocation(), toPath( reference ) );
+ }
public File toFile( ArtifactReference reference )
{