diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-19 19:51:01 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-19 19:51:01 +0100 |
commit | ea1f4cc2987536c3ed3df5899e6cec2df890f1e6 (patch) | |
tree | ceb0324a2829523587c750d771fc83d849ae4e13 /src/Locations/FoldersLocationService.kt | |
parent | d9bfa029b0ecf300ae47cf1033db2d5cb323d705 (diff) | |
download | dokka-ea1f4cc2987536c3ed3df5899e6cec2df890f1e6.tar.gz dokka-ea1f4cc2987536c3ed3df5899e6cec2df890f1e6.tar.bz2 dokka-ea1f4cc2987536c3ed3df5899e6cec2df890f1e6.zip |
refactor extension setup; encapsulate extension in LocationService
Diffstat (limited to 'src/Locations/FoldersLocationService.kt')
-rw-r--r-- | src/Locations/FoldersLocationService.kt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Locations/FoldersLocationService.kt b/src/Locations/FoldersLocationService.kt index 6f3954c4..4f56475c 100644 --- a/src/Locations/FoldersLocationService.kt +++ b/src/Locations/FoldersLocationService.kt @@ -2,10 +2,12 @@ package org.jetbrains.dokka import java.io.File -public fun FoldersLocationService(root: String): FoldersLocationService = FoldersLocationService(File(root)) -public class FoldersLocationService(val root: File) : FileLocationService { +public fun FoldersLocationService(root: String): FoldersLocationService = FoldersLocationService(File(root), "") +public class FoldersLocationService(val root: File, val extension: String) : FileLocationService { + override fun withExtension(newExtension: String): LocationService = FoldersLocationService(root, newExtension) + override fun location(node: DocumentationNode): FileLocation { - return FileLocation(File(root, relativePathToNode(node))) + return FileLocation(File(root, relativePathToNode(node)).appendExtension(extension)) } } |