org.kuali.common.util
Class ProjectUtils

java.lang.Object
  extended by org.kuali.common.util.ProjectUtils

public class ProjectUtils
extends Object


Field Summary
static String KUALI_COMMON_GROUP_ID
          Deprecated. 
static String KUALI_UTIL_ARTIFACT_ID
          Deprecated. 
 
Constructor Summary
ProjectUtils()
           
 
Method Summary
static void clearCache()
          Provide a way to clear the cache
protected static String getBeanProperty(String key, String startsWith)
           
static String getClassPathPrefix(Project project)
          Given a project containing groupId + artifactId, convert the groupId to groupId.base, then return the classpath prefix
static String getClassPathPrefix(String groupId, String artifactId)
          Given a groupId and artifactId, convert the groupId to groupId.base, then return the classpath prefix
static String getClassPathPrefixFromGAV(String projectId)
          Deprecated. 
static String getClassPathPrefixFromProjectId(String projectId)
          Given groupId:artifactId, convert the groupId to groupId.base, then return the classpath prefix
static String getCommonClassPathPrefix(String artifactId)
           kuali-util = classpath:org/kuali/common/kuali-util
static List<Dependency> getDependencies(String csv)
           
static String getGav(Project project)
          Deprecated. 
static String getGav(ProjectContext context)
          Deprecated. 
static String getGav(String groupId, String artifactId)
          Deprecated. 
static Project getProject(Properties properties)
          Return a Project object by copying values from the properties object into a Project object.
static Project getProject(String gav)
          Create a skeleton Project object from the gav.
static String getProjectId(Project project)
           
static String getProjectId(String groupId, String artifactId)
           
static ProjectProperties getProjectProperties(ProjectContext context)
          Deprecated. 
static String getPropertiesFileLocation(Project project)
           
static File getResourceDirectory(File directory, Project project)
          Given a groupId and artifactId, convert the groupId to groupId.base, then return a resource path relative to directory
static File getResourceFile(File directory, Project project, String filename)
          Given a groupId and artifactId, convert the groupId to groupId.base, then return a handle to a file relative to directory with the given filename
static String getResourcePath(Project project)
          Given groupId:artifactId, convert the groupId to groupId.base, then return a resource friendly prefix
protected static Properties loadAndCache(Project project, String projectId)
           
static Project loadProject(ProjectContext context)
          Deprecated. 
static Project loadProject(String projectId)
          Create a Project object from the projectId.
static Project loadProject(String groupId, String artifactId)
          Create a Project object from groupId, artifactId pair.
static List<Project> loadProjects(List<String> projectIds)
           
static Properties loadProperties(Project project)
          Use the groupId and artifactId from this project to load the corresponding project.properties file and cache it in our internal Map
static Properties loadProperties(String gav)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KUALI_COMMON_GROUP_ID

@Deprecated
public static final String KUALI_COMMON_GROUP_ID
Deprecated. 
See Also:
Constant Field Values

KUALI_UTIL_ARTIFACT_ID

@Deprecated
public static final String KUALI_UTIL_ARTIFACT_ID
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

ProjectUtils

public ProjectUtils()
Method Detail

loadProjects

public static List<Project> loadProjects(List<String> projectIds)

getCommonClassPathPrefix

public static String getCommonClassPathPrefix(String artifactId)
   kuali-util = classpath:org/kuali/common/kuali-util
 


getClassPathPrefix

public static String getClassPathPrefix(String groupId,
                                        String artifactId)
Given a groupId and artifactId, convert the groupId to groupId.base, then return the classpath prefix
   org.kuali.student.db:ks-impex-rice-db = classpath:org/kuali/student/ks-impex-rice-db
   org.kuali.common:kuali-util           = classpath:org/kuali/common/kuali-util
 


getClassPathPrefixFromGAV

@Deprecated
public static String getClassPathPrefixFromGAV(String projectId)
Deprecated. 

Given groupId:artifactId, convert the groupId to groupId.base, then return the classpath prefix
   org.kuali.student.db:ks-impex-rice-db = classpath:org/kuali/student/ks-impex-rice-db
   org.kuali.common:kuali-util           = classpath:org/kuali/common/kuali-util
 
Use getClassPathPrefixFromProjectId() instead


getClassPathPrefixFromProjectId

public static String getClassPathPrefixFromProjectId(String projectId)
Given groupId:artifactId, convert the groupId to groupId.base, then return the classpath prefix
   org.kuali.student.db:ks-impex-rice-db = classpath:org/kuali/student/ks-impex-rice-db
   org.kuali.common:kuali-util           = classpath:org/kuali/common/kuali-util
 


getClassPathPrefix

public static String getClassPathPrefix(Project project)
Given a project containing groupId + artifactId, convert the groupId to groupId.base, then return the classpath prefix
   org.kuali.student.db:ks-impex-rice-db = classpath:org/kuali/student/ks-impex-rice-db
   org.kuali.common:kuali-util           = classpath:org/kuali/common/kuali-util
 


getResourceDirectory

public static File getResourceDirectory(File directory,
                                        Project project)
Given a groupId and artifactId, convert the groupId to groupId.base, then return a resource path relative to directory
   org.kuali.student.db:ks-impex-rice-db    = org/kuali/student/ks-impex-rice-db
   org.kuali.common:kuali-util              = org/kuali/common/kuali-util
   
   /tmp/x/y/z + org.kuali.common:kuali-util = /tmp/x/y/z/org/kuali/common/kuali-util
 


getResourceFile

public static File getResourceFile(File directory,
                                   Project project,
                                   String filename)
Given a groupId and artifactId, convert the groupId to groupId.base, then return a handle to a file relative to directory with the given filename
   org.kuali.student.db:ks-impex-rice-db              = org/kuali/student/ks-impex-rice-db
   org.kuali.common:kuali-util                        = org/kuali/common/kuali-util
   
   /tmp/x/y/z + org.kuali.common:kuali-util + foo.txt = /tmp/x/y/z/org/kuali/common/kuali-util/foo.txt
 


getResourcePath

public static String getResourcePath(Project project)
Given groupId:artifactId, convert the groupId to groupId.base, then return a resource friendly prefix
   org.kuali.student.db:ks-impex-rice-db = org/kuali/student/ks-impex-rice-db
   org.kuali.common:kuali-util           = org/kuali/common/kuali-util
 


getProjectProperties

@Deprecated
public static ProjectProperties getProjectProperties(ProjectContext context)
Deprecated. 


loadProject

@Deprecated
public static Project loadProject(ProjectContext context)
Deprecated. 

Create a Project object from the context. This includes loading the corresponding project.properties file from disk.


getGav

@Deprecated
public static String getGav(ProjectContext context)
Deprecated. 


getGav

@Deprecated
public static String getGav(Project project)
Deprecated. 


getGav

@Deprecated
public static String getGav(String groupId,
                                       String artifactId)
Deprecated. 


getProjectId

public static String getProjectId(Project project)

getProjectId

public static String getProjectId(String groupId,
                                  String artifactId)

loadProject

public static Project loadProject(String groupId,
                                  String artifactId)
Create a Project object from groupId, artifactId pair. This includes loading the corresponding project.properties file from disk.


loadProject

public static Project loadProject(String projectId)
Create a Project object from the projectId. This includes loading the corresponding project.properties file from disk.


clearCache

public static void clearCache()
Provide a way to clear the cache


getProject

public static Project getProject(String gav)
Create a skeleton Project object from the gav. Nothing but the GAV info (groupId:artifactId:packaging:version:classifier) gets filled in. Does not read project.properties from disk.


getDependencies

public static List<Dependency> getDependencies(String csv)

getProject

public static Project getProject(Properties properties)
Return a Project object by copying values from the properties object into a Project object.


getBeanProperty

protected static String getBeanProperty(String key,
                                        String startsWith)

loadProperties

public static Properties loadProperties(String gav)

loadProperties

public static Properties loadProperties(Project project)
Use the groupId and artifactId from this project to load the corresponding project.properties file and cache it in our internal Map


loadAndCache

protected static Properties loadAndCache(Project project,
                                         String projectId)

getPropertiesFileLocation

public static String getPropertiesFileLocation(Project project)


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