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.StringabsolutePath()Normalized absolute path.booleanequals(java.lang.Object o)java.io.Filefile()The underlying absoluteFileinthashCode()booleanisFile()Is the component anInputFilejava.lang.Stringkey()Component key shared by all part of SonarQube (scanner, server, WS...).java.lang.StringmoduleKey()java.nio.file.Pathpath()The underlying absolutePathjava.lang.StringrelativePath()Path relative to module base directory.DefaultInputDirsetModuleBaseDir(java.nio.file.Path moduleBaseDir)For testing purpose.java.lang.StringtoString()java.net.URIuri()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:InputDirPath 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/comif module base dir is/path/to/moduleand 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:
relativePathin interfaceInputDir- Specified by:
relativePathin interfaceInputPath- See Also:
InputFile.relativePath(),InputDir.relativePath()
-
absolutePath
public java.lang.String absolutePath()
Description copied from interface:InputDirNormalized 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:
absolutePathin interfaceInputDir- Specified by:
absolutePathin interfaceInputPath- See Also:
InputFile.absolutePath(),InputDir.absolutePath()
-
file
public java.io.File file()
Description copied from interface:InputDirThe underlying absoluteFile- Specified by:
filein interfaceInputDir- Specified by:
filein interfaceInputPath- See Also:
InputFile.file(),InputDir.file()
-
path
public java.nio.file.Path path()
Description copied from interface:InputDirThe underlying absolutePath- Specified by:
pathin interfaceInputDir- Specified by:
pathin interfaceInputPath- See Also:
InputFile.path(),InputDir.path()
-
moduleKey
public java.lang.String moduleKey()
-
key
public java.lang.String key()
Description copied from interface:InputComponentComponent key shared by all part of SonarQube (scanner, server, WS...). It doesn't include the branch. Warning. Do not use in SonarLint.- Specified by:
keyin 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:InputComponentIs the component anInputFile- Specified by:
isFilein interfaceInputComponent
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classDefaultInputComponent
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultInputComponent
-
toString
public java.lang.String toString()
- Overrides:
toStringin classDefaultInputComponent
-
-