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
object Companion
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?

file extension without dot, or null for directories

Link copied to clipboard
open override val hidden: Boolean

whether this entry is hidden

Link copied to clipboard
open override val name: String

filename or directory name

Link copied to clipboard
open override val path: String

complete filesystem 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.