Interface IndexedFile

    • Method Detail

      • relativePath

        @Deprecated
        java.lang.String relativePath()
        Deprecated.
        since 6.6 use inputStream(), filename() or uri()
        Path relative to module base directory. Path is unique and identifies file within given FileSystem. File separator is the forward slash ('/'), even on Microsoft Windows.
        Returns 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.
        Relative path is not null and is normalized ('foo/../foo' is replaced by 'foo').
        Specified by:
        relativePath in interface InputPath
        See Also:
        InputFile.relativePath(), InputDir.relativePath()
      • absolutePath

        @Deprecated
        java.lang.String absolutePath()
        Deprecated.
        since 6.6 use inputStream(), filename() or uri()
        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/index.php. Use file().getCanonicalPath() to resolve symbolic link.
        Specified by:
        absolutePath in interface InputPath
        See Also:
        InputFile.absolutePath(), InputDir.absolutePath()
      • path

        @Deprecated
        java.nio.file.Path path()
        Deprecated.
        since 6.6 use inputStream(), filename() or uri()
        The underlying absolute Path. It should not be used to read the file in the filesystem.
        Specified by:
        path in interface InputPath
        Since:
        5.1
        See Also:
        #contents(), inputStream()
      • uri

        java.net.URI uri()
        Identifier of the file. The only guarantee is that it is unique in the project. You should not assume it is a file:// URI.
        Specified by:
        uri in interface InputPath
        Since:
        6.6
      • filename

        java.lang.String filename()
        Filename for this file (inclusing extension). For example: MyClass.java.
        Since:
        6.6
      • language

        @CheckForNull
        java.lang.String language()
        Language, for example "java" or "php". Can be null if indexation of all files is enabled and no language claims to support the file.
      • inputStream

        java.io.InputStream inputStream()
                                 throws java.io.IOException
        Creates a stream of the file's contents. Depending on the runtime context, the source might be a file in a physical or virtual filesystem. Typically, it won't be buffered. The stream must be closed by the caller.
        Throws:
        java.io.IOException
        Since:
        6.2