|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sonar.api.resources.ProjectUtils
public final class ProjectUtils
Method Summary | |
---|---|
static java.io.File |
getFileFromBuildDirectory(Project project,
java.lang.String filename)
|
static java.lang.String |
getJavaVersion(Project project)
|
static java.lang.String |
getRelativePath(java.io.File file,
java.io.File dir)
getRelativePath("c:/foo/src/my/package/Hello.java", "c:/foo/src") is "my/package/Hello.java" |
static java.lang.String |
getRelativePath(java.io.File file,
java.util.List<java.io.File> dirs)
getRelativePath("c:/foo/src/my/package/Hello.java", ["c:/bar", "c:/foo/src"]) is "my/package/Hello.java". |
static boolean |
hasJavaSources(Project project)
Does the project have at least one java source file ? It does not check test files. |
static boolean |
isDynamicAnalysis(Project project,
boolean includeReuseReportMode)
|
protected static java.io.File |
writeToFile(java.lang.String content,
java.io.File dir,
java.lang.String fileName)
|
static java.io.File |
writeToWorkingDirectory(Project project,
java.lang.String content,
java.lang.String fileName)
Save data into a new file of Sonar working directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean hasJavaSources(Project project)
public static boolean isDynamicAnalysis(Project project, boolean includeReuseReportMode)
public static java.lang.String getJavaVersion(Project project)
public static java.io.File writeToWorkingDirectory(Project project, java.lang.String content, java.lang.String fileName) throws java.io.IOException
java.io.IOException
protected static java.io.File writeToFile(java.lang.String content, java.io.File dir, java.lang.String fileName) throws java.io.IOException
java.io.IOException
public static java.lang.String getRelativePath(java.io.File file, java.io.File dir)
public static java.lang.String getRelativePath(java.io.File file, java.util.List<java.io.File> dirs)
Relative path is composed of slashes. Windows backslaches are replaced by /
public static java.io.File getFileFromBuildDirectory(Project project, java.lang.String filename)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |