Skip to content

Commit 5c048db

Browse files
authored
Add toURI and toURL helpers to os.Path (#399)
Calling `.toNIO.toUri` and `.toNIO.toUri.toURL` is getting annoying
1 parent 6206f3c commit 5c048db

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

os/src/Path.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,8 @@ class Path private[os] (val wrapped: java.nio.file.Path)
620620

621621
def toIO: java.io.File = Path.pathSerializer.value.serializeFile(this)
622622
def toNIO: java.nio.file.Path = Path.pathSerializer.value.serializePath(this)
623+
def toURI: java.net.URI = toNIO.toUri
624+
def toURL: java.net.URL = toURI.toURL
623625

624626
def resolveFrom(base: os.Path) = this
625627

0 commit comments

Comments
 (0)