Package kotlin.io.path

Convenient extensions for working with file system using java.nio.file.Path.

Types

JVM
JRE7
1.8

CopyActionContext

Context for the copyAction function passed to Path.copyToRecursively.

interface CopyActionContext
JVM
JRE7
1.0

CopyActionResult

The result of the copyAction function passed to Path.copyToRecursively that specifies further actions when copying an entry.

enum class CopyActionResult
JVM
JRE7
1.7

FileVisitorBuilder

The builder to provide implementation of the file visitor that fileVisitor builds.

sealed interface FileVisitorBuilder
JVM
JRE7
1.0

OnErrorResult

The result of the onError function passed to Path.copyToRecursively that specifies further actions when an exception occurs.

enum class OnErrorResult
JVM
JRE7
1.0

PathWalkOption

An enumeration to provide walk options for Path.walk function. The options can be combined to form the walk order and behavior needed.

enum class PathWalkOption

Annotations

JVM
JRE7
1.4

ExperimentalPathApi

This annotation marks the extensions and top-level functions for working with java.nio.file.Path considered experimental.

annotation class ExperimentalPathApi

Extensions for External Classes

JVM
JRE7
1.5

java.net.URI

JVM
JRE7
1.4

java.nio.file.Path

Functions

JVM
JRE7
1.5

createTempDirectory

Creates a new directory in the default temp directory, using the given prefix to generate its name.

fun createTempDirectory(
    prefix: String? = null,
    vararg attributes: FileAttribute<*>
): Path

Creates a new directory in the specified directory, using the given prefix to generate its name.

fun createTempDirectory(
    directory: Path?,
    prefix: String? = null,
    vararg attributes: FileAttribute<*>
): Path
JVM
JRE7
1.5

createTempFile

Creates an empty file in the default temp directory, using the given prefix and suffix to generate its name.

fun createTempFile(
    prefix: String? = null,
    suffix: String? = null,
    vararg attributes: FileAttribute<*>
): Path

Creates an empty file in the specified directory, using the given prefix and suffix to generate its name.

fun createTempFile(
    directory: Path?,
    prefix: String? = null,
    suffix: String? = null,
    vararg attributes: FileAttribute<*>
): Path
JVM
JRE7
1.7

fileVisitor

Builds a FileVisitor whose implementation is defined in builderAction.

fun fileVisitor(
    builderAction: FileVisitorBuilder.() -> Unit
): FileVisitor<Path>
JVM
JRE7
1.5

Path

Converts the provided path string to a Path object of the default filesystem.

fun Path(path: String): Path

Converts the name sequence specified with the base path string and a number of subpaths additional names to a Path object of the default filesystem.

fun Path(base: String, vararg subpaths: String): Path