|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sonar.api.resources.Resource<Directory>
org.sonar.api.resources.File
public class File
This class is an implementation of a resource of type FILE
| Field Summary |
|---|
| 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_PROJECT_BRANCH, QUALIFIER_PROJECT_TRUNK, QUALIFIER_SUBVIEW, QUALIFIER_UNIT_TEST_CLASS, QUALIFIER_VIEW, SCOPE_DIRECTORY, SCOPE_ENTITY, SCOPE_FILE, SCOPE_PROJECT, SCOPE_SET, SCOPE_SPACE |
| Constructor Summary | |
|---|---|
File(Language language,
java.lang.String key)
Creates a File from its language and its key |
|
File(Language language,
java.lang.String directory,
java.lang.String filename)
Creates a File from language, directory and filename |
|
File(java.lang.String key)
File in project. |
|
File(java.lang.String directory,
java.lang.String filename)
Creates a file from its containing directory and name |
|
| Method Summary | |
|---|---|
static File |
fromIOFile(java.io.File file,
java.util.List<java.io.File> sourceDirs)
Creates a File from an io.file and a list of sources directories |
static File |
fromIOFile(java.io.File file,
Project project)
Creates a File from its name and a project |
java.lang.String |
getDescription()
|
Language |
getLanguage()
|
java.lang.String |
getLongName()
|
java.lang.String |
getName()
|
Directory |
getParent()
The parent is used to build the resources tree, for example for relations between classes, packages and projects. |
java.lang.String |
getQualifier()
|
java.lang.String |
getScope()
|
boolean |
matchFilePattern(java.lang.String antPattern)
Check resource against an Ant pattern, like mypackag?/*Foo.java. |
void |
setLanguage(Language language)
Sets the language of the file |
java.lang.String |
toString()
|
| Methods inherited from class org.sonar.api.resources.Resource |
|---|
equals, getEffectiveKey, getId, getKey, hashCode, isExcluded, setEffectiveKey, setExcluded, setId, setKey |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public File(java.lang.String key)
new File("org/sonar/foo.sql"). The
absolute path may be c:/myproject/src/main/sql/org/sonar/foo.sql. Project root is c:/myproject and source dir
is src/main/sql.
public File(java.lang.String directory,
java.lang.String filename)
public File(Language language,
java.lang.String key)
public File(Language language,
java.lang.String directory,
java.lang.String filename)
| Method Detail |
|---|
public Directory getParent()
Return null if the parent is the project.
getParent in class Resource<Directory>Resource.getParent()public boolean matchFilePattern(java.lang.String antPattern)
matchFilePattern in class Resource<Directory>antPattern - Ant-like pattern (with **, * and ?). It includes file suffixes.
Resource.matchFilePattern(String)
public static File fromIOFile(java.io.File file,
java.util.List<java.io.File> sourceDirs)
public static File fromIOFile(java.io.File file,
Project project)
public java.lang.String getName()
getName in class Resource<Directory>Resource.getName()public java.lang.String getLongName()
getLongName in class Resource<Directory>Resource.getLongName()public java.lang.String getDescription()
getDescription in class Resource<Directory>Resource.getDescription()public Language getLanguage()
getLanguage in class Resource<Directory>Resource.getLanguage()public void setLanguage(Language language)
public java.lang.String getScope()
getScope in class Resource<Directory>public java.lang.String getQualifier()
getQualifier in class Resource<Directory>public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||