Skip to content

Feature Request: Migrate Java IO to Java NIO APIs where applicable #34

@davidburstrom

Description

@davidburstrom

TL;DR

Use java.nio.file.Path and java.nio.file.Files operations instead of java.io.File wherever possible.

Benefits

  • Easier to integrate in other tools, as the reliance on the real file system goes away.
  • Tests can run faster as one can use https://github.com/google/jimfs to do file operations, instead of hitting the real file system.

My particular reason for this suggestion is that the ValidRelativeLinksRule is trying to resolve files outside of the analysed file. If (for particular reasons) only the analysed file is available on the real file system, the rule will raise a warning. In my case, the referenced file is available in a virtual file system, which is not readable through Java IO.

Cannot be migrated

The APIs provided by Gradle are currently centered around using Files. That is OK, since MarkdownLintPlugin simply has to call projectDir.toPath to convert into the Java NIO realm, given that everything else is migrated.

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions