diff --git a/README.md b/README.md index 2266f0e..5fbe06d 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,26 @@ This is a small project to make a very basic filesystem library in Kotlin and was created using the instructions below as part of my application to the JetBrains internship project "TeamCity Kotlin Script build step extension library". +## Usage + +### Gradle +```kotlin +repositories { + // other repositories + maven { url "https://git.koval.net/api/packages/cyclane/maven" } +} + +dependencies { + // other dependencies + implementation("net.koval.teamcity-build-step-extension-test-task:filesystem:0.1.0") +} +``` + +### Documentation +Use autocompletion and hover menus in your IDE, or download the +[generated HTML documentation](https://git.koval.net/cyclane/teamcity-build-step-extension-test-task/releases/download/v0.1.1/filesystem-0.1.0-javadoc.zip) +from the [latest release](https://git.koval.net/cyclane/teamcity-build-step-extension-test-task/releases). + ## Instructions Create a library implementing four classes: diff --git a/src/main/kotlin/filesystem/FSCreator.kt b/src/main/kotlin/filesystem/FSCreator.kt index 51ef381..a1794ae 100644 --- a/src/main/kotlin/filesystem/FSCreator.kt +++ b/src/main/kotlin/filesystem/FSCreator.kt @@ -6,7 +6,9 @@ import java.nio.file.Files import java.nio.file.Path class FSCreator { - // Create entry, leaving existing folders' contents, but overwriting existing files. + /** + * Create entry, leaving existing folders' contents, but overwriting existing files. + */ @Throws(FileSystemException::class) fun create( entryToCreate: FSEntry, diff --git a/src/main/kotlin/filesystem/FSEntry.kt b/src/main/kotlin/filesystem/FSEntry.kt index 531da2a..3856abd 100644 --- a/src/main/kotlin/filesystem/FSEntry.kt +++ b/src/main/kotlin/filesystem/FSEntry.kt @@ -1,7 +1,7 @@ package filesystem // Note sealed allows for simpler logic in FSCreator by guaranteeing FSFile and FSFolder are the only possible FSEntries -// (as we expect), and it also makes the class abstract as required. +// (as we expect), and it also implicitly makes the class abstract as required. sealed class FSEntry(val name: String) class FSFile(name: String, val content: String) : FSEntry(name)