org.kuali.common.util.maven
Class RepositoryUtils

java.lang.Object
  extended by org.kuali.common.util.maven.RepositoryUtils

public class RepositoryUtils
extends Object


Constructor Summary
RepositoryUtils()
           
 
Method Summary
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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryUtils

public RepositoryUtils()
Method Detail

getDefaultLocalRepository

public static File getDefaultLocalRepository()

copyArtifactToDirectory

public static final void copyArtifactToDirectory(String repository,
                                                 Artifact artifact,
                                                 File localRepository)
Copy an artifact from repository into a local repository.


copyArtifactToFile

public static final void copyArtifactToFile(String repository,
                                            Artifact artifact,
                                            File file)
Copy an artifact from repository to a specific file on the local file system.


toString

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
 


toString

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
 


parseArtifact

public static final Artifact parseArtifact(String gav)

Order is groupId:artifactId:version:classifier:type:scope.


parseDependency

public static final Dependency parseDependency(String gav)

Order is groupId:artifactId:version:classifier:type:scope.


getDelimitedString

protected static final String getDelimitedString(List<String> tokens,
                                                 int delimiterCount,
                                                 String delimiter)

getDelimiterCount

protected static final int getDelimiterCount(List<String> tokens)

toNull

@Deprecated
public static String toNull(String token)
Deprecated. Use NullUtils.isNullOrNone() instead

Return null if token is blank, "NULL", or "NONE"


toEmpty

public static String toEmpty(String token)
Return the empty string if token is blank, "NULL", or "NONE"


getRepositoryPath

public static final String getRepositoryPath(Artifact artifact)
  org.kuali.common:kuali-util:2.0.1 -> org/kuali/common/kuali-util/2.0.1
 


getFilename

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
 


getFile

public static final File getFile(File localRepositoryDir,
                                 Artifact artifact)


Copyright © 2010-2013 The Kuali Foundation. All Rights Reserved.