Package org.sonar.api.batch.fs.internal
Class DefaultInputDir
- java.lang.Object
-
- org.sonar.api.batch.fs.internal.DefaultInputComponent
-
- org.sonar.api.batch.fs.internal.DefaultInputDir
-
- All Implemented Interfaces:
InputComponent
,InputDir
,InputPath
public class DefaultInputDir extends DefaultInputComponent implements InputDir
- Since:
- 4.5
-
-
Constructor Summary
Constructors Constructor Description DefaultInputDir(java.lang.String moduleKey, java.lang.String relativePath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
absolutePath()
Normalized absolute path.boolean
equals(java.lang.Object o)
java.io.File
file()
The underlying absoluteFile
int
hashCode()
boolean
isFile()
Is the component anInputFile
java.lang.String
key()
Component key shared by all part of SonarQube (scanner, server, WS...).java.lang.String
moduleKey()
java.nio.file.Path
path()
The underlying absolutePath
java.lang.String
relativePath()
Path relative to module base directory.DefaultInputDir
setModuleBaseDir(java.nio.file.Path moduleBaseDir)
For testing purpose.java.lang.String
toString()
java.net.URI
uri()
Identifier of the component.-
Methods inherited from class org.sonar.api.batch.fs.internal.DefaultInputComponent
hasMeasureFor, scannerId, setHasMeasureFor
-
-
-
-
Method Detail
-
relativePath
public java.lang.String relativePath()
Description copied from interface:InputDir
Path relative to module base directory. Path is unique and identifies directory within given
. File separator is the forward slash ('/'), even on Microsoft Windows.FileSystem
Returnssrc/main/java/com
if module base dir is/path/to/module
and if directory is/path/to/module/src/main/java/com
.
Relative path is not null and is normalized ('foo/../foo' is replaced by 'foo').- Specified by:
relativePath
in interfaceInputDir
- Specified by:
relativePath
in interfaceInputPath
- See Also:
InputFile.relativePath()
,InputDir.relativePath()
-
absolutePath
public java.lang.String absolutePath()
Description copied from interface:InputDir
Normalized absolute path. File separator is forward slash ('/'), even on Microsoft Windows.
This is not canonical path. Symbolic links are not resolved. For example if /project/src links to /tmp/src and basedir is /project, then this method returns /project/src. Usefile().getCanonicalPath()
to resolve symbolic link.- Specified by:
absolutePath
in interfaceInputDir
- Specified by:
absolutePath
in interfaceInputPath
- See Also:
InputFile.absolutePath()
,InputDir.absolutePath()
-
file
public java.io.File file()
Description copied from interface:InputDir
The underlying absoluteFile
- Specified by:
file
in interfaceInputDir
- Specified by:
file
in interfaceInputPath
- See Also:
InputFile.file()
,InputDir.file()
-
path
public java.nio.file.Path path()
Description copied from interface:InputDir
The underlying absolutePath
- Specified by:
path
in interfaceInputDir
- Specified by:
path
in interfaceInputPath
- See Also:
InputFile.path()
,InputDir.path()
-
moduleKey
public java.lang.String moduleKey()
-
key
public java.lang.String key()
Description copied from interface:InputComponent
Component key shared by all part of SonarQube (scanner, server, WS...). It doesn't include the branch. Warning. Do not use in SonarLint.- Specified by:
key
in interfaceInputComponent
-
setModuleBaseDir
public DefaultInputDir setModuleBaseDir(java.nio.file.Path moduleBaseDir)
For testing purpose. Will be automatically set when dir is added toDefaultFileSystem
-
isFile
public boolean isFile()
Description copied from interface:InputComponent
Is the component anInputFile
- Specified by:
isFile
in interfaceInputComponent
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classDefaultInputComponent
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classDefaultInputComponent
-
toString
public java.lang.String toString()
- Overrides:
toString
in classDefaultInputComponent
-
-