Interface ContentProvider

  • All Known Implementing Classes:
    FileContentProvider, MixedContentProvider, SubdirectoryDecorator

    public interface ContentProvider
    Represents some content provider - it is used by IprSettings code to obtain content of project files, iml files and so on. In fact, it is really light interface to VCS or to filesystem. The implementation of the interface should be fed to IdeaSettings class.
    See Also:
    IdeaSettings
    • Method Detail

      • getContent

        @Nullable
        InputStream getContent​(@Nullable
                               String relativePath)
                        throws VcsException,
                               FileNotFoundException
        Get a content of the file from data source represented by this content provider.
        Parameters:
        relativePath - path for the requested item
        Returns:
        input stream for the data located for the given path. input stream should be closed by the calling code
        Throws:
        FileNotFoundException - when there is no file for the given relative path
        VcsException - when there is some error while obtaining input file for the requested file
      • listItems

        @NotNull
        List<VcsItem> listItems​(@NotNull
                                String relativePath)
                         throws VcsException,
                                FileNotFoundException
        List available items for given path (both files and directories)
        Parameters:
        relativePath - path for the requested directory
        Returns:
        list of items available for the given path. Root path is represented by "." or empty string
        Throws:
        FileNotFoundException - when there is no file for the given relative path
        VcsException - when there is some error while obtaining list of sub-items