Implement resource identifier associated with a resource_store and a path.
class base resource identifier
extends debuggable
implements resource identifier
private resource store the resource store
private string the scheme
private immutable list[string] path
base resource identifier(resource store the resource store, string the scheme, immutable list[string] path)
this • the resource store = the resource store
this • the scheme = the scheme
this • path = path
override base resource identifier parent()
if parent path size is nonnegative
parent path : path • slice(0, parent path size)
return base resource identifier • new(the resource store, the scheme, path • slice(0, parent path size))
else
return this
implement string scheme => the scheme
implement string or null host()
if path • size > 2 && path[0] • is empty && path[1] • is empty
return path[2]
else
return missing • instance
override resource[string] access string(access option or null options)
return string resource • new(this, options)