P
- the type of Resource
this implementation of ResourceOrigin produces.public interface ResourceOrigin<P extends Resource>
Modifier and Type | Interface and Description |
---|---|
static class |
ResourceOrigin.ResourceNotFoundException
Thrown when a given path can't be found.
|
Modifier and Type | Method and Description |
---|---|
P |
getByPath(String path)
Retrieves a
Resource object based on the given path. |
String |
getName()
Returns the name of this origin.
|
P |
getRoot()
Returns the
Resource for this origin's declared root. |
boolean |
hasPath(String path) |
void |
traverseWith(ResourceVisitor visitor)
Traverses this ResourceOrigin from the root, according to the given
ResourceVisitor . |
void |
watchForChanges(ResourceVisitor visitor)
Sets up observation for this origin, and hooks it to the given callback
ResourceVisitor . |
String getName()
void traverseWith(ResourceVisitor visitor)
ResourceVisitor
.void watchForChanges(ResourceVisitor visitor)
ResourceVisitor
.ResourceVisitor
,
PredicatedResourceVisitor
P getByPath(String path)
Resource
object based on the given path. The given path may or may not start with a
leading /, but will always be considered relative to whatever root path this origin uses; for the user of this
class, such paths should thus be considered absolute, depending on the implementation, they may be relative
to some other path. Directory traversal navigation should be prohibited by implementations for security reasons.ResourceOrigin.ResourceNotFoundException
- if the path does not exist in this ResourceOriginboolean hasPath(String path)
Copyright © 2003–2016 Magnolia International Ltd.. All rights reserved.