Verified Commit 773eb8ee authored by AtjonTV's avatar AtjonTV

Extensions: Remove String.asDirectory; Remove Directory Test

parent 6d1c66e3
Pipeline #2123 passed with stages
in 6 minutes and 38 seconds
......@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- JsonKraken 1.0 Source
- kSock (`klib.net.socket.kSock`)
- Directory (`klib.files.Directory`)
- `asDirectory` extension for File
### Fixed
### Security
......
......@@ -8,7 +8,6 @@ import java.util.Base64
import klib.encoding.base.Base58e
import klib.exceptions.InvalidValueException
import klib.exceptions.RequireValueException
import klib.files.Directory
import klib.hash.Sha1
import klib.hash.Sha256
import klib.kLibInf
......@@ -265,16 +264,6 @@ fun String.fromBase64(): String {
*/
fun String.asFile() = File(this)
/**
* Uses the string as path for a new Directory object
*
* @return Directory object with string as path
*
* @since 4.0.0
* @author Thomas Obernosterer
*/
fun String.asDirectory() = Directory(this)
/**
* Opens the string as file and returns the input stream
*
......
package devtests
import klib.extensions.asDirectory
import klib.extensions.replaceAllOf
fun main() {
val directory = "/stmp/vulture".asDirectory()
val cppFiles = directory.findWithExtension("cpp").toMutableList()
cppFiles.replaceAllOf("Vulture", "Cookie", true)
directory.addFiles(cppFiles)
directory.writeAll()
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment