AvailFile

abstract class AvailFile(val fileWrapper: AbstractFileWrapper)

AvailFile is a specification for declaring behavior and state for a file that has been opened from the hierarchy of an Avail ModuleRoot.

Author

Richard Arriaga

Parameters

fileWrapper

The AbstractFileWrapper that wraps this AvailFile.

Inheritors

Constructors

Link copied to clipboard
constructor(fileWrapper: AbstractFileWrapper)

Construct an AvailFile.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

true indicates the file is open; false indicates it is closed.

Link copied to clipboard

Time in milliseconds since the unix epoch UTC when this file was lasted edited.

Link copied to clipboard

The last time in milliseconds since the Unix epoch that the file was updated.

Link copied to clipboard

The mime type of this file.

Link copied to clipboard
abstract val rawContent: ByteArray

The raw bytes of the file.

Functions

Link copied to clipboard

Indicate this file has been edited to be different than what is saved to disk.

Link copied to clipboard
abstract fun editRange(data: ByteArray, start: Int, end: Int, timestamp: Long = System.currentTimeMillis(), originator: UUID): TracedAction

Insert the ByteArray data into the file at the specified location. This should remove existing data in the file in this range and replace it with the provided data. This should preserve all data outside of this range.

Link copied to clipboard
Link copied to clipboard

Indicate this file has been edited to be different than what is saved to disk.

Link copied to clipboard
abstract fun replaceFile(data: ByteArray, timestamp: Long = System.currentTimeMillis(), originator: UUID): TracedAction

Replace the entire contents of the file with the provided byte array.