@Immutable public class DefaultIndexedFile extends DefaultInputComponent implements IndexedFile
| Constructor and Description |
|---|
DefaultIndexedFile(java.nio.file.Path absolutePath,
java.lang.String projectKey,
java.lang.String projectRelativePath,
java.lang.String moduleRelativePath,
InputFile.Type type,
java.lang.String language,
int batchId,
SensorStrategy sensorStrategy) |
DefaultIndexedFile(java.lang.String projectKey,
java.nio.file.Path baseDir,
java.lang.String relativePath,
java.lang.String language)
Testing purposes only!
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
absolutePath()
Normalized absolute path.
|
boolean |
equals(java.lang.Object o) |
java.io.File |
file()
The underlying absolute
File. |
java.lang.String |
filename()
Filename for this file (inclusing extension).
|
java.lang.String |
getModuleRelativePath() |
java.lang.String |
getProjectRelativePath() |
int |
hashCode() |
java.io.InputStream |
inputStream()
Creates a stream of the file's contents.
|
boolean |
isFile()
Is the component an
InputFile |
java.lang.String |
key()
Component key (without branch).
|
java.lang.String |
language()
Language, for example "java" or "php".
|
java.nio.file.Path |
path()
The underlying absolute
Path. |
java.lang.String |
relativePath()
Path relative to module base directory.
|
java.lang.String |
toString() |
InputFile.Type |
type()
Does it contain main or test code ?
|
java.net.URI |
uri()
Identifier of the file.
|
hasMeasureFor, scannerId, setHasMeasureForpublic DefaultIndexedFile(java.lang.String projectKey,
java.nio.file.Path baseDir,
java.lang.String relativePath,
@Nullable
java.lang.String language)
public DefaultIndexedFile(java.nio.file.Path absolutePath,
java.lang.String projectKey,
java.lang.String projectRelativePath,
java.lang.String moduleRelativePath,
InputFile.Type type,
@Nullable
java.lang.String language,
int batchId,
SensorStrategy sensorStrategy)
public java.lang.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 java.lang.String getModuleRelativePath()
public java.lang.String getProjectRelativePath()
public java.lang.String absolutePath()
IndexedFilefile().getCanonicalPath() to resolve symbolic link.absolutePath in interface IndexedFileabsolutePath in interface InputPathInputFile.absolutePath(),
InputDir.absolutePath()public java.io.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 java.nio.file.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 java.io.InputStream inputStream()
throws java.io.IOException
IndexedFileinputStream in interface IndexedFilejava.io.IOException@CheckForNull public java.lang.String language()
IndexedFilelanguage in interface IndexedFilepublic InputFile.Type type()
IndexedFiletype in interface IndexedFilepublic java.lang.String key()
key in interface InputComponentpublic boolean equals(java.lang.Object o)
equals in class DefaultInputComponentpublic int hashCode()
hashCode in class DefaultInputComponentpublic java.lang.String toString()
toString in class DefaultInputComponentpublic boolean isFile()
InputComponentInputFileisFile in interface InputComponentpublic java.lang.String filename()
IndexedFilefilename in interface IndexedFilepublic java.net.URI uri()
IndexedFileuri in interface IndexedFileuri in interface InputPath