ReadOnly

A read-only object implementing file system provider interfaces for handling file serialization, selection, and reading functionalities.

This object combines the functionalities of FileSystemProvider.ReadOnly, FileSystemProvider.Select, and FileSystemProvider.Read using delegation. It provides operations for path serialization, structure navigation, and content reading in a read-only manner.

Functions

Link copied to clipboard
open suspend override fun exists(path: Path): Boolean

Checks if a given path exists in the file system.

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

Retrieves the file extension from the specified path using the serialization logic.

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

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

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

Resolves a given relative path string against a base path and returns the normalized path.

Link copied to clipboard
open suspend override fun list(path: Path): List<Path>

Lists all the paths under a specified directory or file path.

Link copied to clipboard
open suspend override fun metadata(path: Path): FileMetadata?

Retrieves the metadata associated with the specified file or directory.

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

Retrieves the name of the given path.

Link copied to clipboard
open suspend override fun parent(path: Path): Path?

Retrieves the parent directory/path of the given path.

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

Reads the content of the file at the specified path.

Link copied to clipboard
open suspend override fun relative(root: Path, path: Path): String?

Computes the relative path from a given root path to the specified path.

Link copied to clipboard
open suspend override fun relativize(root: Path, path: Path): String?

Relativizes the given path path based on the specified root path. This function calculates the relative path from the root to the path.

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

Retrieves the size of the file or directory at the specified path.

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

Provides access to a data source represented by the given path.

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

Converts the given Path to its absolute path string representation.

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

Converts the specified path to its string representation.