@Immutable public class DefaultIndexedFile extends DefaultInputComponent implements IndexedFile
| Constructor and Description |
|---|
DefaultIndexedFile(Path absolutePath,
String moduleKey,
String projectRelativePath,
String moduleRelativePath,
InputFile.Type type,
String language,
int batchId,
SensorStrategy sensorStrategy) |
DefaultIndexedFile(String moduleKey,
Path baseDir,
String relativePath,
String language)
Testing purposes only!
|
| Modifier and Type | Method and Description |
|---|---|
String |
absolutePath()
Normalized absolute path.
|
boolean |
equals(Object o) |
File |
file()
The underlying absolute
File. |
String |
filename()
Filename for this file (inclusing extension).
|
String |
getModuleRelativePath() |
String |
getProjectRelativePath() |
int |
hashCode() |
InputStream |
inputStream()
Creates a stream of the file's contents.
|
boolean |
isFile()
Is the component an
InputFile |
String |
key()
Component key (without branch).
|
String |
language()
Language, for example "java" or "php".
|
String |
moduleKey() |
Path |
path()
The underlying absolute
Path. |
String |
relativePath()
Path relative to module base directory.
|
String |
toString() |
InputFile.Type |
type()
Does it contain main or test code ?
|
URI |
uri()
Identifier of the file.
|
batchIdpublic DefaultIndexedFile(String moduleKey, Path baseDir, String relativePath, @Nullable String language)
public DefaultIndexedFile(Path absolutePath, String moduleKey, String projectRelativePath, String moduleRelativePath, InputFile.Type type, @Nullable String language, int batchId, SensorStrategy sensorStrategy)
public String relativePath()
IndexedFileFileSystem. File separator is the forward
slash ('/'), even on Microsoft Windows.
src/main/java/com/Foo.java if module base dir is
/path/to/module and if file is
/path/to/module/src/main/java/com/Foo.java.
relativePath in interface IndexedFilerelativePath in interface InputPathInputFile.relativePath(),
InputDir.relativePath()public String getModuleRelativePath()
public String getProjectRelativePath()
public String absolutePath()
IndexedFilefile().getCanonicalPath() to resolve symbolic link.absolutePath in interface IndexedFileabsolutePath in interface InputPathInputFile.absolutePath(),
InputDir.absolutePath()public File file()
IndexedFileFile. It should not be used to read the file in the filesystem.file in interface IndexedFilefile in interface InputPath#contents(),
IndexedFile.inputStream()public Path path()
IndexedFilePath.
It should not be used to read the file in the filesystem.path in interface IndexedFilepath in interface InputPath#contents(),
IndexedFile.inputStream()public InputStream inputStream() throws IOException
IndexedFileinputStream in interface IndexedFileIOException@CheckForNull public String language()
IndexedFilelanguage in interface IndexedFilepublic InputFile.Type type()
IndexedFiletype in interface IndexedFilepublic String key()
key in interface InputComponentpublic boolean equals(Object o)
equals in class DefaultInputComponentpublic int hashCode()
hashCode in class DefaultInputComponentpublic String toString()
toString in class DefaultInputComponentpublic boolean isFile()
InputComponentInputFileisFile in interface InputComponentpublic String filename()
IndexedFilefilename in interface IndexedFilepublic URI uri()
IndexedFileuri in interface IndexedFileuri in interface InputPathCopyright © 2009–2017 SonarSource. All rights reserved.