Read

Provides utility methods for reading file data and retrieving file-related metadata. Implements the FileSystemProvider.Read and delegates file serialization operations to the Serialization interface.

Functions

Link copied to clipboard
open suspend override fun extension(path: Path): String

Retrieves the file extension from the specified path.

Link copied to clipboard
open override fun fromAbsoluteString(path: String): Path

Converts a string representation of an absolute file path into a Path object.

Link copied to clipboard
open override fun fromRelativeString(base: Path, path: String): Path

Converts a relative path string to a Path object by resolving it against a base path.

Link copied to clipboard
open suspend override fun name(path: Path): String

Retrieves the name of the file or directory represented by the given path.

Link copied to clipboard
open suspend override fun read(path: Path): ByteArray

Reads the contents of the file located at the specified path.

Link copied to clipboard
open suspend override fun size(path: Path): Long

Returns the size of the regular file at the specified path.

Link copied to clipboard
open suspend override fun source(path: Path): Source

Opens a source to read from the specified file path.

Link copied to clipboard
open override fun toAbsolutePathString(path: Path): String

Converts a given Path object into its absolute path representation as a string.

Link copied to clipboard
open override fun toPathString(path: Path): String

Converts the given path to a string representation of the file path.