Package monster.nor.prunes.io

Types

Link copied to clipboard
class GuaranteeDirectory(path: Path)

フォルダへの読み込み・書き込みができることを保証する

Functions

Link copied to clipboard
fun Path.confirm(rhs: Path)
Link copied to clipboard
fun Path.contentEquals(file: Path): Boolean

ファイル内容のバイナリ比較

Link copied to clipboard
fun Path.copyRecursively(dst: Path): Boolean

フォルダを再帰的にコピーする dst が存在する場合エラーとなる

Link copied to clipboard
fun Path.deleteRecursively(): Boolean

ディレクトリを再帰的に削除

Link copied to clipboard
fun Path.directoryCompare(other: Path): Quartet<Boolean, List<Path>, List<Path>, List<Path>>

ディレクトリの内容を比較する

Link copied to clipboard
fun Boolean.fail(closure: () -> Unit)
Link copied to clipboard
fun Path.firstLine(cs: Charset = StandardCharsets.UTF_8): String

ファイルから先頭行を取り出す

Link copied to clipboard
fun Path.inCreateDirectory(name: Path): Path
fun Path.inCreateDirectory(name: String? = null): Path
Link copied to clipboard
fun Path.inCreateFile(name: String? = null): Path
Link copied to clipboard
fun Path.inCreateFileIfNotExists(name: String): Path
Link copied to clipboard
fun Path.inCreateFiles(vararg names: String): List<Path>
Link copied to clipboard
fun Path.inUuidDirectory(): Path
Link copied to clipboard
fun Path.moveDirectoryToDirectory(distDir: Path): Path

このディレクトリを distDir の中に移動 移動先は distDir.resolve(this.fileName) となる 移動先に同一フォルダがあり内容が同じ場合、古いフォルダを消して上書きする

Link copied to clipboard
fun Pair<Path, Path>.moveToDir(dist: Path): Path?

dist.resolve(this.first.fileName).createDirectory()

Link copied to clipboard
fun Path.newInputStream(): InputStream
Link copied to clipboard
fun Path.safeDelete(): Boolean
Link copied to clipboard
fun Path.search(glob: String): Path?

Find the file in the directory. Returns the first file found, or NULL if not found.

Link copied to clipboard
fun Path.show()
Link copied to clipboard
fun Path.showString(): String
Link copied to clipboard
fun temporaryDirectory(rootDir: Path? = null, closure: (Path) -> Unit)

テンポラリディレクトリを作成する。 作成されたディレクトリはスコープ終了時に削除される。

Link copied to clipboard
fun String.toPath(): Path

Create Path object from this String.

Link copied to clipboard
fun uuid(): String

uuid() = UUID.randomUUID().toString()

Properties

Link copied to clipboard
val Path.baseName: String
Link copied to clipboard
val LINE: String