public class RepositoryUtils extends Object
Constructor and Description |
---|
RepositoryUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copyArtifactToDirectory(String repository,
Artifact artifact,
File localRepository)
Copy an artifact from
repository into a local repository. |
static void |
copyArtifactToFile(String repository,
Artifact artifact,
File file)
Copy an artifact from
repository to a specific file on the local file system. |
static boolean |
exists(File localRepositoryDir,
Artifact artifact) |
static File |
getDefaultLocalRepository() |
protected static String |
getDelimitedString(List<String> tokens,
int delimiterCount,
String delimiter) |
protected static int |
getDelimiterCount(List<String> tokens) |
static File |
getFile(File localRepositoryDir,
Artifact artifact) |
static String |
getFilename(Artifact artifact)
org.kuali.common:kuali-util:2.0.1::jar -> kuali-util-2.0.1.jar
org.kuali.common:kuali-util:2.0.1:sql:jar -> kuali-util-2.0.1-sql.jar
|
static String |
getRepositoryPath(Artifact artifact)
org.kuali.common:kuali-util:2.0.1 -> org/kuali/common/kuali-util/2.0.1
|
static Artifact |
parseArtifact(String gav)
Order is
groupId:artifactId:version:classifier:type:scope . |
static Dependency |
parseDependency(String gav)
Order is
groupId:artifactId:version:classifier:type:scope . |
static String |
toEmpty(String token)
Return the empty string if token is blank, "NULL", or "NONE"
|
static String |
toNull(String token)
Deprecated.
Use NullUtils.isNullOrNone() instead
|
static String |
toString(Artifact artifact)
Order is
groupId:artifactId:version:classifier:type . |
static String |
toString(Dependency dependency)
Order is
groupId:artifactId:version:classifier:type:scope . |
public RepositoryUtils()
public static File getDefaultLocalRepository()
public static final void copyArtifactToDirectory(String repository, Artifact artifact, File localRepository)
repository
into a local repository.public static final void copyArtifactToFile(String repository, Artifact artifact, File file)
repository
to a specific file on the local file system.public static final String toString(Artifact artifact)
Order is groupId:artifactId:version:classifier:type
. The ordering here matches the order Maven uses to create actual files. Which is different from what the
toString() method on Maven's Artifact object produces.
Trailing :
's are omitted.
If every field is left blank, ::::
is returned.
org.kuali.common:kuali-jdbc:1.0.0:webapp:jar - groupId + artifactId + version + classifier + type org.kuali.common:kuali-jdbc:1.0.0::jar - no classifier :::: - Every field is blank org.kuali.common - groupId only ::::jar - type only :kuali-jdbc:::jar - no groupId, version, classifier, or type org.kuali.common:kuali-jdbc - groupId + artifactId org.kuali.common:kuali-jdbc:1.0.0 - groupId + artifactId + version org.kuali.common:kuali-jdbc:1.0.0:webapp - no type org.kuali.common:kuali-jdbc:1.0.0 - no classifier or type org.kuali.common:kuali-jdbc::webapp:jar - no version
public static final String toString(Dependency dependency)
Order is groupId:artifactId:version:classifier:type:scope
. The ordering here matches the order Maven uses to create actual files. As opposed to what the
toString() method on Maven's Dependency object produces.
Trailing :
's are omitted.
If every field is left blank, :::::
is returned.
org.kuali.common:kuali-jdbc:1.0.0:webapp:jar:compile - groupId + artifactId + version + classifier + type + scope org.kuali.common:kuali-jdbc:1.0.0::jar:compile - no classifier org.kuali.common:kuali-jdbc:1.0.0:webapp:jar: - no scope ::::: - Every field is blank org.kuali.common - groupId only :::::compile - scope only :kuali-jdbc:::jar - artifactId + type org.kuali.common:kuali-jdbc - groupId + artifactId org.kuali.common:kuali-jdbc:1.0.0 - groupId + artifactId + version org.kuali.common:kuali-jdbc:1.0.0:webapp - groupId + artifactId + version + classifier org.kuali.common:kuali-jdbc:1.0.0:::compile - no classifier or type org.kuali.common:kuali-jdbc::webapp:jar:compile - no version
public static final Artifact parseArtifact(String gav)
Order is groupId:artifactId:version:classifier:type:scope
.
public static final Dependency parseDependency(String gav)
Order is groupId:artifactId:version:classifier:type:scope
.
protected static final String getDelimitedString(List<String> tokens, int delimiterCount, String delimiter)
protected static final int getDelimiterCount(List<String> tokens)
@Deprecated public static String toNull(String token)
public static String toEmpty(String token)
public static final String getRepositoryPath(Artifact artifact)
org.kuali.common:kuali-util:2.0.1 -> org/kuali/common/kuali-util/2.0.1
public static final String getFilename(Artifact artifact)
org.kuali.common:kuali-util:2.0.1::jar -> kuali-util-2.0.1.jar org.kuali.common:kuali-util:2.0.1:sql:jar -> kuali-util-2.0.1-sql.jar
Copyright © 2010–2014 The Kuali Foundation. All rights reserved.