ResolverReference

class ResolverReference(val resolver: ModuleRootResolver, val uri: URI, val qualifiedName: String, val type: ResourceType, mimeType: String, lastModified: Long, size: Long, localName: String = "", val forcedDigest: ByteArray? = null)

A ResolverReference is a reference to a module or a module resource within a ModuleRoot produced by a ModuleRootResolver.

Author

Richard Arriaga

Parameters

resolver

The ModuleRoot the file referenced by ResolverReference belongs to.

The URI of the file this ResolverReference refers to.

qualifiedName

The fully-qualified name of the module or resource.

type

The ResourceType that describes what this reference points to.

mimeType

The file MIME type of the associated resource.

lastModified

The time in millis since the unix epoch, preferably UTC, when this was last modified. This value will be zero for directories.

size

The size in bytes of the file or 0 if a directory.

Constructors

Link copied to clipboard
constructor(resolver: ModuleRootResolver, uri: URI, qualifiedName: String, type: ResourceType, mimeType: String, lastModified: Long, size: Long, localName: String = "", forcedDigest: ByteArray? = null)

Construct a ResolverReference.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The exception that prevented the most recent attempt at accessing the source location of this ResolverReference.

Link copied to clipboard
val forcedDigest: ByteArray? = null

If the source file's digest was captured within a jar file, always use it as the digest, and never computed it.

Link copied to clipboard

true indicates that either modules or resources is not empty. false indicates they are both empty.

Link copied to clipboard

true iff the ResolverReference represents a module, false otherwise.

Link copied to clipboard

true iff the ResolverReference represents a package, false otherwise.

Link copied to clipboard

true iff the ResolverReference represents a package representative module, false otherwise.

Link copied to clipboard

Indicates whether or not this ResolverReference is a resource, not a module nor package. true if it is either a ResourceType.RESOURCE or ResourceType.DIRECTORY; false otherwise.

Link copied to clipboard

true iff the ResolverReference represents a root, false otherwise.

Link copied to clipboard

The last known time this was updated since the Unix Epoch.

Link copied to clipboard

The local name of the file referenced by this ModuleName.

Link copied to clipboard

The file MIME type of the associated resource or empty String if package/directory.

Link copied to clipboard

The ModuleName of this module/resource.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The fully-qualified name of the module or resource.

Link copied to clipboard

The ModuleRoot the file referenced by ResolverReference belongs to.

Link copied to clipboard
Link copied to clipboard
var size: Long

The size, in bytes, of the backing file, or 0 if isPackage is true.

Link copied to clipboard
val type: ResourceType

The ResourceType that describes what this ResolverReference refers to.

Link copied to clipboard
val uri: URI

The URI of the file this ResolverReference refers to.

Functions

Link copied to clipboard

Answer the List of child ResolverReferences owned by the ResolverReference.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun file(rawBytes: ByteArray): AvailFile

Answer an AvailFile for the given raw bytes. This should be the contents of the file represented by this ResolverReference.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Is this ResolverReference a direct child of the provided ResolverReference?

Link copied to clipboard

Is this ResolverReference a descendant of the provided ResolverReference?

Link copied to clipboard
fun readFileBytes(bypassFileManager: Boolean, withContents: (ByteArray, UUID?) -> Unit, failureHandler: (ErrorCode, Throwable?) -> Unit)

Retrieve the resource and provide it with a request to obtain the raw file bytes.

Link copied to clipboard
fun readFileString(bypassFileManager: Boolean, withContents: (String, UUID?) -> Unit, failureHandler: (ErrorCode, Throwable?) -> Unit)
Link copied to clipboard
fun refresh(lastModified: Long, size: Long)

Update the mutable state of this ResolverReference.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun walkChildrenThen(visitResources: Boolean, withReference: (ResolverReference) -> Unit, afterAllVisited: (Int) -> Unit = {})

Walk the children of this ResolverReference. This reference must be either a root, package, or directory.

Link copied to clipboard
fun writeOn(writer: JSONWriter, builder: AvailBuilder)

Write the ModuleNode to the supplied JSONWriter.