|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sonar.api.resources.File
public class File
This class is an implementation of a resource of type FILE
| Field Summary |
|---|
| Fields inherited from interface org.sonar.api.resources.Resource |
|---|
QUALIFIER_CLASS, QUALIFIER_DIRECTORY, QUALIFIER_FILE, 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,
String key)
Creates a File from its language and its key |
|
File(Language language,
String directory,
String filename)
Creates a File from language, directory and filename |
|
File(String key)
File in project. |
|
File(String directory,
String filename)
Creates a file from its containing directory and name |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
static File |
fromIOFile(File file,
List<File> sourceDirs)
Creates a File from an io.file and a list of sources directories |
static File |
fromIOFile(File file,
Project project)
Creates a File from its name and a project |
String |
getDescription()
|
String |
getKey()
|
Language |
getLanguage()
|
String |
getLongName()
|
String |
getName()
|
Directory |
getParent()
The parent is used to build the resources tree, for example for relations between classes, packages and projects. |
String |
getQualifier()
|
String |
getScope()
|
int |
hashCode()
|
boolean |
matchFilePattern(String antPattern)
Check resource against an Ant pattern, like mypackag?/*Foo.java. |
void |
setLanguage(Language language)
Sets the language of the file |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public File(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(String directory,
String filename)
public File(Language language,
String key)
public File(Language language,
String directory,
String filename)
| Method Detail |
|---|
public Directory getParent()
Return null if the parent is the project.
getParent in interface Resource<Directory>Resource.getParent()public boolean matchFilePattern(String antPattern)
matchFilePattern in interface Resource<Directory>antPattern - Ant-like pattern (with **, * and ?). It includes file suffixes.
Resource.matchFilePattern(String)
public static File fromIOFile(File file,
List<File> sourceDirs)
public static File fromIOFile(File file,
Project project)
public String getKey()
getKey in interface Resource<Directory>Resource.getKey()public String getName()
getName in interface Resource<Directory>Resource.getName()public String getLongName()
getLongName in interface Resource<Directory>Resource.getLongName()public String getDescription()
getDescription in interface Resource<Directory>Resource.getDescription()public Language getLanguage()
getLanguage in interface Resource<Directory>Resource.getLanguage()public void setLanguage(Language language)
public String getScope()
getScope in interface Resource<Directory>public String getQualifier()
getQualifier in interface Resource<Directory>public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||