AbstractAvailTextFile

abstract class AbstractAvailTextFile(val charset: Charset, val fileWrapper: AbstractFileWrapper) : AvailFile

A AbstractAvailTextFile is an abstract AvailFile that is has text in a provided Charset.

Author

Richard Arriaga

Parameters

charset

The Charset of the file.

fileWrapper

The AbstractFileWrapper that wraps this AvailFile.

Constructors

Link copied to clipboard
constructor(charset: Charset, fileWrapper: AbstractFileWrapper)

Construct an AvailFile.

Properties

Link copied to clipboard

The Charset of the file.

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.