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.

Constructors

Link copied to clipboard
fun AvailFile(fileWrapper: AbstractFileWrapper)

Construct an AvailFile.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun conditionallyClearDirty(saveTimeStart: Long)

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
open fun getSavableContent(): ByteArray
Link copied to clipboard
fun markDirty()

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.

Properties

Link copied to clipboard
val fileWrapper: AbstractFileWrapper

The AbstractFileWrapper that wraps this AvailFile.

Link copied to clipboard
val isOpen: Boolean

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

Link copied to clipboard
var lastEdit: Long = 0

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

Link copied to clipboard
var lastModified: Long

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

Link copied to clipboard
val mimeType: String

The mime type of this file.

Link copied to clipboard
abstract val rawContent: ByteArray

The raw bytes of the file.

Inheritors

Link copied to clipboard