@Immutable public class DefaultIndexedFile extends DefaultInputComponent implements IndexedFile
| Constructor and Description |
|---|
DefaultIndexedFile(String moduleKey,
Path moduleBaseDir,
String relativePath,
InputFile.Type type,
String language,
int batchId) |
DefaultIndexedFile(String moduleKey,
Path moduleBaseDir,
String relativePath,
String language)
Testing purposes only!
|
DefaultIndexedFile(String moduleKey,
Path moduleBaseDir,
String relativePath,
String language,
int batchId) |
| Modifier and Type | Method and Description |
|---|---|
String |
absolutePath()
Normalized absolute path.
|
boolean |
equals(Object o) |
File |
file()
The underlying absolute
File. |
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 ?
|
batchIdpublic DefaultIndexedFile(String moduleKey, Path moduleBaseDir, String relativePath, @Nullable String language)
public DefaultIndexedFile(String moduleKey, Path moduleBaseDir, String relativePath, @Nullable String language, int batchId)
public DefaultIndexedFile(String moduleKey, Path moduleBaseDir, String relativePath, InputFile.Type type, @Nullable String language, int batchId)
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 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 InputComponentCopyright © 2009–2017 SonarSource. All rights reserved.