Class 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 Detail

      • DefaultIndexedFile

        public DefaultIndexedFile​(java.lang.String projectKey,
                                  java.nio.file.Path baseDir,
                                  java.lang.String relativePath,
                                  @Nullable
                                  java.lang.String language)
        Testing purposes only!
      • DefaultIndexedFile

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

      • relativePath

        public java.lang.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 java.lang.String getModuleRelativePath()
      • getProjectRelativePath

        public java.lang.String getProjectRelativePath()
      • absolutePath

        public java.lang.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 java.io.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 java.nio.file.Path path()
        Specified by:
        path in interface org.sonar.api.batch.fs.IndexedFile
        Specified by:
        path in interface org.sonar.api.batch.fs.InputPath
      • inputStream

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

        @CheckForNull
        public java.lang.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 java.lang.String key()
        Component key (without branch).
        Specified by:
        key in interface org.sonar.api.batch.fs.InputComponent
      • isFile

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

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

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