Brooklyn

brooklyn.util.maven
[Java] Class MavenRetriever

java.lang.Object
  brooklyn.util.maven.MavenRetriever

public class MavenRetriever

returns the URL for accessing the artifact, assuming sonatype for snapshots and maven.org for releases by default, with some methods checking local file system, and allowing the generators for each to be specified


Field Summary
static Function LOCAL_REPO_PATH_GENERATOR

static Function MAVEN_CENTRAL_URL_GENERATOR

static Function SONATYPE_SNAPSHOT_URL_GENERATOR

protected Function releaseUrlGenerator

protected Function snapshotUrlGenerator

 
Method Summary
java.lang.String getHostedUrl(MavenArtifact artifact)

java.lang.String getLocalPath(MavenArtifact artifact)

java.lang.String getLocalUrl(MavenArtifact artifact)

returns a URL for accessing the given artifact, preferring a local file if available, else generating a hosted URL (but not checking)

static java.lang.String hostedUrl(MavenArtifact artifact)

returns a URL for accessing the artifact from any machine (ie not allowing a local repo), using the default remote sits (sonatype for snapshots and maven.org for releases)

boolean isInstalledLocally(MavenArtifact artifact)

static java.lang.String localUrl(MavenArtifact artifact)

returns a URL for accessing the artifact from the local machine (ie preferring a local repo), using the default remote sits (sonatype for snapshots and maven.org for releases)

void setReleaseUrlGenerator(Function releaseUrlGenerator)

void setSnapshotUrlGenerator(Function snapshotUrlGenerator)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

LOCAL_REPO_PATH_GENERATOR

public static final Function LOCAL_REPO_PATH_GENERATOR


MAVEN_CENTRAL_URL_GENERATOR

public static final Function MAVEN_CENTRAL_URL_GENERATOR


SONATYPE_SNAPSHOT_URL_GENERATOR

public static final Function SONATYPE_SNAPSHOT_URL_GENERATOR


releaseUrlGenerator

protected Function releaseUrlGenerator


snapshotUrlGenerator

protected Function snapshotUrlGenerator


 
Method Detail

getHostedUrl

public java.lang.String getHostedUrl(MavenArtifact artifact)


getLocalPath

public java.lang.String getLocalPath(MavenArtifact artifact)


getLocalUrl

public java.lang.String getLocalUrl(MavenArtifact artifact)
returns a URL for accessing the given artifact, preferring a local file if available, else generating a hosted URL (but not checking)


hostedUrl

public static java.lang.String hostedUrl(MavenArtifact artifact)
returns a URL for accessing the artifact from any machine (ie not allowing a local repo), using the default remote sits (sonatype for snapshots and maven.org for releases)


isInstalledLocally

public boolean isInstalledLocally(MavenArtifact artifact)


localUrl

public static java.lang.String localUrl(MavenArtifact artifact)
returns a URL for accessing the artifact from the local machine (ie preferring a local repo), using the default remote sits (sonatype for snapshots and maven.org for releases)


setReleaseUrlGenerator

public void setReleaseUrlGenerator(Function releaseUrlGenerator)


setSnapshotUrlGenerator

public void setSnapshotUrlGenerator(Function snapshotUrlGenerator)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.