Support java.nio.file.Path in clojure.java.io

Description

java.nio.file.Path objects are largely equivalent to java.io.File. They represent a location in a (possibly-remote) filesystem.

Coercions in clojure.java.io don't recognize java.nio.file.Path. It would be nice if they did.

Prescreened: Alex Miller

Patch: CLJ-2333-1.patch

Environment

None

Activity

Show:
Andrew Oberstar
June 28, 2018, 3:37 AM

Added a patch that supports java.nio.file.Path in Coercions and IOFactory. There are more places (particularly the do-copy multimethod) that might warrant Path support, but this seemed like a good start.

Note, in case there's any confusion, I have signed the CA (June 17th), though my name is not yet on the site's list of CA signers.

Arne Brasseur
November 14, 2018, 8:19 AM

java.nio.file.Path was added in Java 7, which is perhaps why this change didn't make it in before. Clojure 1.10 will require Java 8, so perhaps it's time to consider this patch.

Hugo Duncan
September 30, 2020, 1:42 PM

This would be useful, even if it were just the Coercion implementation for Path.

Assignee

Unassigned

Reporter

Michael Nygard

Labels

Approval

Prescreened

Patch

Code and Test

Affects versions

Priority

Major