-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Merge pull request #130 from vinceglb/129-javaneturisyntaxexception…
…-illegal-character-in-path 🐛 Fix Illegal character in path on Linux
- Loading branch information
Showing
5 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
filekit-core/src/jvmTest/kotlin/io/github/vinceglb/filekit/core/platform/xdg/URITest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.github.vinceglb.filekit.core.platform.xdg | ||
|
||
import java.net.URI | ||
import java.nio.file.Paths | ||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
class URITest { | ||
@Test | ||
fun testSimpleURI() { | ||
val path = "/home/user/file.txt" | ||
val uri = URI(path) | ||
assertEquals(path, uri.path) | ||
} | ||
|
||
@Test | ||
fun testURIWithSpaces() { | ||
val path = "/home/user/file with spaces.txt" | ||
val filePath = Paths.get(path) | ||
val uri = filePath.toUri() | ||
assertEquals(path, uri.path) | ||
} | ||
|
||
@Test | ||
fun testURIWithSpecialCharacters() { | ||
val path = "/home/user/Ubuntu [24.04].file" | ||
val filePath = Paths.get(path) | ||
val uri = filePath.toUri() | ||
assertEquals(path, uri.path) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Thu Apr 04 20:22:39 CEST 2024 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |