diff options
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 8a0cf6be..89b34ed1 100644 --- a/src/Locations/FoldersLocationService.kt +++ b/src/Locations/FoldersLocationService.kt @@ -5,14 +5,16 @@ import com.google.inject.name.Named import java.io.File public fun FoldersLocationService(root: String): FoldersLocationService = FoldersLocationService(File(root), "") -public class FoldersLocationService @Inject constructor(@Named("outputDir") val root: File, val extension: String) : FileLocationService { +public class FoldersLocationService @Inject constructor(@Named("outputDir") val rootFile: File, val extension: String) : FileLocationService { + override val root: Location + get() = FileLocation(rootFile) override fun withExtension(newExtension: String): FileLocationService { - return if (extension.isEmpty()) FoldersLocationService(root, newExtension) else this + return if (extension.isEmpty()) FoldersLocationService(rootFile, newExtension) else this } override fun location(qualifiedName: List<String>, hasMembers: Boolean): FileLocation { - return FileLocation(File(root, relativePathToNode(qualifiedName, hasMembers)).appendExtension(extension)) + return FileLocation(File(rootFile, relativePathToNode(qualifiedName, hasMembers)).appendExtension(extension)) } } |