File

data class File(val name: String, val extension: String?, val path: String, val hidden: Boolean, val size: List<FileSize>, val contentType: FileMetadata.FileContentType, val content: FileSystemEntry.File.Content = Content.None) : FileSystemEntry(source)

Represents a file in the filesystem.

Constructors

Link copied to clipboard
constructor(name: String, extension: String?, path: String, hidden: Boolean, size: List<FileSize>, contentType: FileMetadata.FileContentType, content: FileSystemEntry.File.Content = Content.None)

Types

Link copied to clipboard
sealed interface Content

Represents file content as none, full text, or excerpt.

Properties

Link copied to clipboard

file content, defaults to Content.None

Link copied to clipboard

file content type from FileMetadata.FileContentType

Link copied to clipboard
open override val extension: String?

Represents the optional file extension of the file system entry.

Link copied to clipboard
open override val hidden: Boolean

Indicates whether the file system entry is hidden.

Link copied to clipboard
open override val name: String

Represents the name as a string value. This variable is typically used to hold textual data corresponding to a name.

Link copied to clipboard
open override val path: String

Represents a filesystem or resource path.

Link copied to clipboard

list of FileSize measurements for this file

Functions

Link copied to clipboard
open suspend override fun visit(depth: Int, visitor: suspend (FileSystemEntry) -> Unit)

Visits this file by calling visitor once.