Package avail.files

Types

Link copied to clipboard
abstract class AbstractAvailTextFile(val charset: Charset, val fileWrapper: AbstractFileWrapper) : AvailFile

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

Link copied to clipboard
abstract class AbstractFileWrapper(    val id: UUID,     val reference: ResolverReference,     fileManager: FileManager)

A AbstractFileWrapper is an abstraction for holding an AvailFile. The purpose of this is to enable the Avail server FileManager cache to delay establishing the type of AvailFile until the file type can be read without delaying adding a file object to the FileManager cache.

Link copied to clipboard
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.

Link copied to clipboard
class EditRange(    val data: ByteArray,     start: Int,     end: Int) : FileAction

EditRange is a FileAction that effectively first removes data from the stated range (with an exclusive upper bound), then splits the file and inserts the new data at the position where the first element was removed.

Link copied to clipboard
class ErrorFileWrapper(    val id: UUID,     resolverReference: ResolverReference,     fileManager: FileManager,     val error: Throwable,     val errorCode: ErrorCode) : AbstractFileWrapper

A ErrorServerFileWrapper is a AbstractFileWrapper that encountered an error when accessing the underlying file.

Link copied to clipboard
interface FileAction

FileAction declares the methods and states for a performing a FileActionType on an AvailFile.

Link copied to clipboard
enum FileActionType : Enum<FileActionType>

FileActionType is an enum that describes the types of actions that can be requested occur when interacting with an AvailFile.

Link copied to clipboard
enum FileErrorCode : Enum<FileErrorCode> , ErrorCode

FileErrorCode is an enumeration of ErrorCode that list errors that can happen while dealing with files.

Link copied to clipboard
object FileErrorCodeRange : ErrorCodeRange

A FileErrorCodeRange is an ErrorCodeRange that holds defined error codes that involve failures while handling files.

Link copied to clipboard
open class FileManager

FileManager manages the access to the source and resource files in Avail s. It provides an LRU caching mechanism by which open files can be added and removed as needed to control the number of open files in memory.

Link copied to clipboard
class ManagedFileWrapper(    val id: UUID,     resolverReference: ResolverReference,     fileManager: FileManager) : AbstractFileWrapper

A ManagedFileWrapper is an AbstractFileWrapper used by the FileManager to hold an AvailFile that is on the file system of the machine Avail is running. The purpose of this is to enable the FileManager cache to delay establishing the type of the AvailFile until the file type can be read without delaying adding a file object to the FileManager cache.

Link copied to clipboard
object NoAction : FileAction

NoAction is a FileAction indicates no action should/could be taken.

Link copied to clipboard
class NullFileWrapper(    raw: ByteArray,     resolverReference: ResolverReference,     fileManager: FileManager) : AbstractFileWrapper

A NullFileWrapper is an AbstractFileWrapper not used by the FileManager to hold an AvailFile that is on the file system of the machine Avail is running. The purpose of this is to enable access outside of the FileManager.

Link copied to clipboard
object RedoAction : FileAction

RedoAction is a FileAction that re-executes a recently undonetracedFileAction.

Link copied to clipboard
class ReplaceContents(val data: ByteArray) : FileAction

ReplaceContents is a FileAction that replaces the entire contents of a file.

Link copied to clipboard
class SaveAction(fileManager: FileManager, failureHandler: (ErrorCode, Throwable?) -> Unit) : FileAction

SaveAction is a FileAction that forces a save of an AvailFile to disk outside of the normal save mechanism.

Link copied to clipboard
class TracedAction(    timestamp: Long,     originator: UUID,     forwardAction: FileAction,     reverseAction: FileAction)

A TracedAction records a FileAction that was performed on a file and the FileActions required to undo the initial FileAction.

Link copied to clipboard
object UndoAction : FileAction

UndoAction is a FileAction that executes the inverse for a FileAction that is traced as a TracedAction.