Class DefaultIndexedFile

java.lang.Object
org.sonar.api.batch.fs.internal.DefaultInputComponent
org.sonar.api.batch.fs.internal.DefaultIndexedFile
All Implemented Interfaces:
org.sonar.api.batch.fs.IndexedFile, org.sonar.api.batch.fs.InputComponent, org.sonar.api.batch.fs.InputPath

@Immutable public class DefaultIndexedFile extends DefaultInputComponent implements org.sonar.api.batch.fs.IndexedFile
Since:
6.3
  • Constructor Details

    • DefaultIndexedFile

      public DefaultIndexedFile(String projectKey, Path baseDir, String relativePath, @Nullable String language)
      Testing purposes only!
    • DefaultIndexedFile

      public DefaultIndexedFile(Path absolutePath, String projectKey, String projectRelativePath, String moduleRelativePath, org.sonar.api.batch.fs.InputFile.Type type, @Nullable String language, int batchId, SensorStrategy sensorStrategy)
    • DefaultIndexedFile

      public DefaultIndexedFile(Path absolutePath, String projectKey, String projectRelativePath, String moduleRelativePath, org.sonar.api.batch.fs.InputFile.Type type, @Nullable String language, int batchId, SensorStrategy sensorStrategy, @Nullable String oldRelativeFilePath)
  • Method Details

    • relativePath

      public String relativePath()
      Specified by:
      relativePath in interface org.sonar.api.batch.fs.IndexedFile
      Specified by:
      relativePath in interface org.sonar.api.batch.fs.InputPath
    • getModuleRelativePath

      public String getModuleRelativePath()
    • getProjectRelativePath

      public String getProjectRelativePath()
    • absolutePath

      public String absolutePath()
      Specified by:
      absolutePath in interface org.sonar.api.batch.fs.IndexedFile
      Specified by:
      absolutePath in interface org.sonar.api.batch.fs.InputPath
    • file

      public File file()
      Specified by:
      file in interface org.sonar.api.batch.fs.IndexedFile
      Specified by:
      file in interface org.sonar.api.batch.fs.InputPath
    • path

      public Path path()
      Specified by:
      path in interface org.sonar.api.batch.fs.IndexedFile
      Specified by:
      path in interface org.sonar.api.batch.fs.InputPath
    • oldRelativePath

      @CheckForNull public String oldRelativePath()
    • inputStream

      public InputStream inputStream() throws IOException
      Specified by:
      inputStream in interface org.sonar.api.batch.fs.IndexedFile
      Throws:
      IOException
    • language

      @CheckForNull public String language()
      Specified by:
      language in interface org.sonar.api.batch.fs.IndexedFile
    • type

      public org.sonar.api.batch.fs.InputFile.Type type()
      Specified by:
      type in interface org.sonar.api.batch.fs.IndexedFile
    • key

      public String key()
      Component key (without branch).
      Specified by:
      key in interface org.sonar.api.batch.fs.InputComponent
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class DefaultInputComponent
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class DefaultInputComponent
    • toString

      public String toString()
      Overrides:
      toString in class DefaultInputComponent
    • isFile

      public boolean isFile()
      Specified by:
      isFile in interface org.sonar.api.batch.fs.InputComponent
    • filename

      public String filename()
      Specified by:
      filename in interface org.sonar.api.batch.fs.IndexedFile
    • uri

      public URI uri()
      Specified by:
      uri in interface org.sonar.api.batch.fs.IndexedFile
      Specified by:
      uri in interface org.sonar.api.batch.fs.InputPath