FsEntry

class FsEntry

A platform-neutral handle to a file or directory, bound to the FileSystem backend that created it. An entry provides path math, existence and metadata queries, content reading, and directory listing, without exposing the underlying I/O engine.

Entries are created via FileSystem.resolve or derived from other entries (resolve, parent, children).

Properties

Link copied to clipboard

This entry with symbolic links resolved, if it exists; falls back to its absolute, normalized form otherwise.

Link copied to clipboard

Whether this entry exists.

Link copied to clipboard

The file extension, without the leading dot, or an empty string if there is none.

Link copied to clipboard

The full path string of this entry, suitable for display and error messages.

Link copied to clipboard

fullPath with / as the separator on every platform, suitable for URLs.

Link copied to clipboard

Whether this entry's path is absolute.

Link copied to clipboard

Whether this entry exists and is a directory.

Link copied to clipboard

Whether this entry exists and is a regular file.

Link copied to clipboard

The last modification timestamp in epoch milliseconds, if available.

Link copied to clipboard

The file or directory name, including any extension.

Link copied to clipboard

The file name without its last extension.

Link copied to clipboard

This entry with redundant path segments (., ..) resolved lexically.

Link copied to clipboard

The parent entry, or null if this entry has no parent.

Functions

Link copied to clipboard

Lists the direct children of this directory entry.

Link copied to clipboard

Walks this directory entry recursively.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun isSubPathOf(ancestor: FsEntry): Boolean

Whether this entry is located in ancestor or any of its subdirectories. Both paths are canonicalized when possible, so a symbolic link inside ancestor pointing outside it is correctly detected as not being a sub-path.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun relativeTo(other: FsEntry): FsEntry?

Computes this entry's path relative to other.

Link copied to clipboard
fun resolve(child: String): FsEntry

Resolves a child path against this entry.

Link copied to clipboard

Converts this entry to a File, if it is backed by the physical disk file system. This is the boundary between the platform-neutral input abstraction and JVM-only output or process-level code; input-side code must not use it.

Link copied to clipboard
fun FsEntry.toOutputResource(name: String = this.name, useChecksumInvalidation: Boolean = false, symlink: Boolean = false): OutputResource

Converts this entry to an OutputResource for the pipeline to output.

Link copied to clipboard
open override fun toString(): String