InputFile.@Deprecated public class File extends Resource
| Modifier and Type | Field and Description |
|---|---|
static String |
SCOPE
Deprecated.
|
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 and Description |
|---|
File(Language language,
String relativePathFromSourceDir)
Deprecated.
|
File(Language language,
String relativeDirectoryPathFromSourceDir,
String filename)
Deprecated.
since 4.2 use
fromIOFile(java.io.File, Project) |
File(String relativePathFromSourceDir)
Deprecated.
|
File(String relativeDirectoryPathFromSourceDir,
String filename)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static File |
create(String relativePathFromBasedir)
Deprecated.
|
static File |
create(String relativePathFromBasedir,
Language language,
boolean unitTest)
Deprecated.
|
static File |
fromIOFile(File file,
List<File> sourceDirs)
Deprecated.
since 4.2 use
fromIOFile(java.io.File, Project) |
static File |
fromIOFile(File file,
Project module)
Deprecated.
|
String |
getDescription()
Deprecated.
|
Language |
getLanguage()
Deprecated.
|
String |
getLongName()
Deprecated.
|
String |
getName()
Deprecated.
|
Directory |
getParent()
Deprecated.
The parent is used to build the resources tree, for example for relations between files, directories and projects.
|
String |
getQualifier()
Deprecated.
Returns the qualifier associated to this File.
|
String |
getScope()
Deprecated.
|
boolean |
matchFilePattern(String antPattern)
Deprecated.
Check resource against an Ant pattern, like mypackag?/*Foo.java.
|
String |
relativePathFromSourceDir()
Deprecated.
Internal.
|
void |
setLanguage(Language language)
Deprecated.
Sets the language of the file
|
void |
setQualifier(String qualifier)
Deprecated.
|
String |
toString()
Deprecated.
|
equals, getEffectiveKey, getId, getKey, getPath, getUuid, hashCode, isExcluded, language, normalize, setEffectiveKey, setExcluded, setId, setKey, setPath, setUuidpublic static final String SCOPE
@Deprecated public File(String relativePathFromSourceDir)
FileSystem.inputFile(org.sonar.api.batch.fs.FilePredicate)@Deprecated public File(String relativeDirectoryPathFromSourceDir, String filename)
FileSystem.inputFile(org.sonar.api.batch.fs.FilePredicate)@Deprecated public File(Language language, String relativePathFromSourceDir)
FileSystem.inputFile(org.sonar.api.batch.fs.FilePredicate)@Deprecated public File(Language language, String relativeDirectoryPathFromSourceDir, String filename)
fromIOFile(java.io.File, Project)public String relativePathFromSourceDir()
public Directory getParent()
Return null if the parent is the current project (or module in case of multi-module).
getParent in class ResourceResource.getParent()public boolean matchFilePattern(String antPattern)
matchFilePattern in class ResourceantPattern - Ant-like pattern (with **, * and ?). It includes file suffixes.Resource.matchFilePattern(String)@Deprecated @CheckForNull public static File fromIOFile(File file, List<File> sourceDirs)
fromIOFile(java.io.File, Project)@Deprecated @CheckForNull public static File fromIOFile(File file, Project module)
FileSystem.inputFile(org.sonar.api.batch.fs.FilePredicate)File from an absolute File and a module.
The returned File can be then passed for example to
SensorContext.saveMeasure(Resource, org.sonar.api.measures.Measure).file - absolute path to a filemodule - public String getName()
getName in class ResourceResource.getName()public String getLongName()
getLongName in class ResourceResource.getLongName()public String getDescription()
getDescription in class ResourceResource.getDescription()public Language getLanguage()
getLanguage in class ResourceFiles may have a non null value.Resource.getLanguage()public void setLanguage(Language language)
public String getQualifier()
getQualifier in class Resourcefor the list of qualifiers,
to find out if a resource if a class, a unit test,... from its qualifierpublic void setQualifier(String qualifier)
@Deprecated public static File create(String relativePathFromBasedir)
FileSystem.inputFile(org.sonar.api.batch.fs.FilePredicate)@Deprecated public static File create(String relativePathFromBasedir, Language language, boolean unitTest)
FileSystem.inputFile(org.sonar.api.batch.fs.FilePredicate)Copyright © 2009–2017 SonarSource. All rights reserved.