|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.resources.Resource org.sonar.api.resources.Directory
public class Directory
Field Summary | |
---|---|
static String |
ROOT
|
static String |
SEPARATOR
|
Fields inherited from class org.sonar.api.resources.Resource |
---|
QUALIFIER_CLASS, QUALIFIER_DIRECTORY, QUALIFIER_FIELD, QUALIFIER_FILE, QUALIFIER_LIB, QUALIFIER_METHOD, QUALIFIER_MODULE, QUALIFIER_PACKAGE, QUALIFIER_PROJECT, QUALIFIER_SUBVIEW, QUALIFIER_UNIT_TEST_CLASS, QUALIFIER_VIEW, SCOPE_ENTITY, SCOPE_SET, SCOPE_SPACE |
Constructor Summary | |
---|---|
Directory(String relativePathFromSourceDir)
Deprecated. since 4.2 use fromIOFile(java.io.File, Project) |
|
Directory(String relativePathFromSourceDir,
Language language)
Deprecated. since 4.2 use fromIOFile(java.io.File, Project) |
Method Summary | |
---|---|
static Directory |
create(String relativePathFromBaseDir)
Create a Directory that is partially initialized. |
static Directory |
create(String relativePathFromBaseDir,
String relativePathFromSourceDir)
Create a directory that is fully initialized. |
static Directory |
fromIOFile(File dir,
Project module)
Creates a Directory from an absolute File and a module. |
String |
getDescription()
|
Language |
getLanguage()
|
String |
getLongName()
|
String |
getName()
|
Resource |
getParent()
The parent is used to build the resources tree, for example for relations between classes, packages and projects. |
String |
getQualifier()
The qualifier tells the type of the resource. |
String |
getScope()
|
boolean |
matchFilePattern(String antPattern)
Check resource against an Ant pattern, like mypackag?/*Foo.java. |
static String |
parseKey(String key)
|
String |
toString()
|
Methods inherited from class org.sonar.api.resources.Resource |
---|
equals, getDeprecatedKey, getEffectiveKey, getId, getKey, getPath, hashCode, isExcluded, normalize, setDeprecatedKey, setEffectiveKey, setExcluded, setId, setKey, setPath |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String SEPARATOR
public static final String ROOT
Constructor Detail |
---|
@Deprecated public Directory(String relativePathFromSourceDir)
fromIOFile(java.io.File, Project)
@Deprecated public Directory(String relativePathFromSourceDir, Language language)
fromIOFile(java.io.File, Project)
Method Detail |
---|
public String getName()
getName
in class Resource
public String getLongName()
getLongName
in class Resource
public String getDescription()
getDescription
in class Resource
public Language getLanguage()
getLanguage
in class Resource
File
s have a non null value.public String getScope()
getScope
in class Resource
public String getQualifier()
Resource
getQualifier
in class Resource
for the list of qualifiers
,
to find out if a resource if a class, a unit test,... from its qualifier
public Resource getParent()
Resource
Return null if the parent is the project.
getParent
in class Resource
public boolean matchFilePattern(String antPattern)
Resource
matchFilePattern
in class Resource
antPattern
- Ant-like pattern (with **, * and ?). It includes file suffixes.
public static String parseKey(String key)
@CheckForNull public static Directory fromIOFile(File dir, Project module)
Directory
from an absolute File
and a module.
The returned Directory
can be then passed for example to
SensorContext.saveMeasure(Resource, org.sonar.api.measures.Measure)
.
dir
- absolute path to a directorymodule
-
public static Directory create(String relativePathFromBaseDir)
SensorContext.saveMeasure(Resource, org.sonar.api.measures.Measure)
when resources are already indexed.
Internal use only.
public static Directory create(String relativePathFromBaseDir, String relativePathFromSourceDir)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |