Skip to content

Commit 2877f4a

Browse files
authored
Rename fromAbsoluteString to fromAbsolutePathString (#567)
1 parent 0ad5994 commit 2877f4a

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

rag/rag-base/src/commonMain/kotlin/ai/koog/rag/base/files/FileSystemProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public object FileSystemProvider {
3232
* @return A path object representing the absolute path.
3333
* @throws IllegalArgumentException if [path] is not absolute.
3434
*/
35-
public fun fromAbsoluteString(path: String): Path
35+
public fun fromAbsolutePathString(path: String): Path
3636

3737
/**
3838
* Resolves a [path] string against a [base] path.

rag/rag-base/src/commonMain/kotlin/ai/koog/rag/base/files/FilteredFileSystemProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ internal open class FilteredReadOnly<P>(
8282

8383
override fun toAbsolutePathString(path: P): String = fs.toAbsolutePathString(path)
8484

85-
override fun fromAbsoluteString(path: String): P = fs.fromAbsoluteString(path)
85+
override fun fromAbsolutePathString(path: String): P = fs.fromAbsolutePathString(path)
8686

8787
override fun fromRelativeString(base: P, path: String): P = fs.fromRelativeString(base, path)
8888

rag/rag-base/src/jvmMain/kotlin/ai/koog/rag/base/files/JVMFileSystemProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public object JVMFileSystemProvider {
6767
* @return The normalized Path representation of the given string.
6868
* @throws IllegalArgumentException if the resolved path is not absolute.
6969
*/
70-
override fun fromAbsoluteString(path: String): Path {
70+
override fun fromAbsolutePathString(path: String): Path {
7171
val resolvedPath = Path.of(toSystemDependentName(path)).normalize()
7272
require(resolvedPath.isAbsolute) { "Resolved path must be absolute" }
7373
return resolvedPath

rag/rag-base/src/jvmTest/kotlin/ai/koog/rag/base/files/JVMFileSystemProviderTest.kt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class JVMFileSystemProviderTest : KoogTestBase() {
3939
private val readWrite = JVMFileSystemProvider.ReadWrite
4040

4141
@Test
42-
fun `test fromAbsoluteString with non-existent path`() {
42+
fun `test fromAbsolutePathString with non-existent path`() {
4343
val nonExistentPath = file1.absolute().pathString + "non_existent"
44-
val result = readOnly.fromAbsoluteString(nonExistentPath).toString()
44+
val result = readOnly.fromAbsolutePathString(nonExistentPath).toString()
4545
assertEquals(nonExistentPath, result)
4646
}
4747

@@ -147,9 +147,9 @@ class JVMFileSystemProviderTest : KoogTestBase() {
147147
}
148148

149149
@Test
150-
fun `test ReadOnly fromAbsoluteString`() {
150+
fun `test ReadOnly fromAbsolutePathString`() {
151151
val filePathString = file1.absolute().pathString
152-
val fileFromPath = readOnly.fromAbsoluteString(filePathString)
152+
val fileFromPath = readOnly.fromAbsolutePathString(filePathString)
153153
assertEquals(file1, fileFromPath)
154154
}
155155

@@ -260,14 +260,14 @@ class JVMFileSystemProviderTest : KoogTestBase() {
260260
@Test
261261
fun `test ReadOnly path windows delimiters`() {
262262
val filePathString = file1.absolute().pathString.replace("/", "\\")
263-
val fileFromString = readOnly.fromAbsoluteString(filePathString)
263+
val fileFromString = readOnly.fromAbsolutePathString(filePathString)
264264
assertEquals(file1, fileFromString)
265265
}
266266

267267
@Test
268268
fun `test ReadOnly path unix delimiters`() {
269269
val filePathString = file1.absolute().pathString.replace("\\", "/")
270-
val fileFromString = readOnly.fromAbsoluteString(filePathString)
270+
val fileFromString = readOnly.fromAbsolutePathString(filePathString)
271271
assertEquals(file1, fileFromString)
272272
}
273273

@@ -279,10 +279,10 @@ class JVMFileSystemProviderTest : KoogTestBase() {
279279
}
280280

281281
@Test
282-
fun `test ReadOnly fromAbsoluteString throws exception when resolved path is not absolute`() {
282+
fun `test ReadOnly fromAbsolutePathString throws exception when resolved path is not absolute`() {
283283
val relativePathString = "relative/test/path"
284284
assertThrows(IllegalArgumentException::class.java) {
285-
readOnly.fromAbsoluteString(relativePathString)
285+
readOnly.fromAbsolutePathString(relativePathString)
286286
}
287287
}
288288

@@ -303,7 +303,7 @@ class JVMFileSystemProviderTest : KoogTestBase() {
303303
@Test
304304
fun `test ReadOnly path starting with slash windows`() {
305305
val filePathString = "\\" + file1.absolute().pathString.replace("/", "\\")
306-
val fileFromString = readOnly.fromAbsoluteString(filePathString)
306+
val fileFromString = readOnly.fromAbsolutePathString(filePathString)
307307
assertEquals(file1, fileFromString)
308308
}
309309

@@ -401,9 +401,9 @@ class JVMFileSystemProviderTest : KoogTestBase() {
401401
}
402402

403403
@Test
404-
fun `test ReadWrite fromAbsoluteString`() {
404+
fun `test ReadWrite fromAbsolutePathString`() {
405405
val filePathString = file1.absolute().pathString
406-
val fileFromPath = readWrite.fromAbsoluteString(filePathString)
406+
val fileFromPath = readWrite.fromAbsolutePathString(filePathString)
407407
assertEquals(file1, fileFromPath)
408408
}
409409

rag/rag-base/src/jvmTest/kotlin/ai/koog/rag/base/files/JVMFilteredFileSystemProviderTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class JVMFilteredFileSystemProviderTest : KoogTestBase() {
9191
fun `test select does not throw`() {
9292
assertNotNull(fsReadOnly.parent(src2))
9393
assertNotNull(fsReadOnly.fromRelativeString(src2, assertNotNull(fsReadOnly.relativize(src2, file2))))
94-
assertNotNull(fsReadOnly.fromAbsoluteString(assertNotNull(fsReadOnly.toAbsolutePathString(file2))))
94+
assertNotNull(fsReadOnly.fromAbsolutePathString(assertNotNull(fsReadOnly.toAbsolutePathString(file2))))
9595
assertNotNull(fsReadOnly.name(src2))
9696
assertNotNull(fsReadOnly.extension(file2))
9797
}

rag/vector-storage/src/commonTest/kotlin/ai/koog/rag/vector/mocks/MockDocumentProviders.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class MockDocumentProvider(val mockFileSystem: MockFileSystem) : DocumentProvide
4545
class MockFileSystemProvider(val mockFileSystem: MockFileSystem) : FileSystemProvider.ReadWrite<String> {
4646
override fun toAbsolutePathString(path: String): String = path
4747

48-
override fun fromAbsoluteString(path: String): String = path
48+
override fun fromAbsolutePathString(path: String): String = path
4949

5050
override fun fromRelativeString(base: String, path: String): String = "$base/$path"
5151

0 commit comments

Comments
 (0)