public class LayeredResourceOrigin extends AbstractResourceOrigin<LayeredResource>
ResourceOrigin
which aggregates
other instances of ResourceOrigin
; resources located on the same path will
be served from the foremost ResourceOrigin, but resources that exist only on one path will always be served.ResourceOrigin.ResourceNotFoundException
dispatchResourceChange, getName, initializeResourceChangeMonitoring, openStream, traverseWith, watchForChanges
public LayeredResource getRoot()
ResourceOrigin
Resource
for this origin's declared root.public ResourceChangeHandlerRegistration registerResourceChangeHandler(ResourceChangeHandler changeHandler)
ResourceOrigin
handler
.registerResourceChangeHandler
in interface ResourceOrigin<LayeredResource>
registerResourceChangeHandler
in class AbstractResourceOrigin<LayeredResource>
ResourceOriginChange
public LayeredResource getByPath(String path)
ResourceOrigin
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.public boolean hasPath(String path)
protected boolean isFile(LayeredResource resource)
isFile
in class AbstractResourceOrigin<LayeredResource>
Resource.isFile()
protected boolean isDirectory(LayeredResource resource)
isDirectory
in class AbstractResourceOrigin<LayeredResource>
Resource.isDirectory()
protected boolean isEditable(LayeredResource resource)
isEditable
in class AbstractResourceOrigin<LayeredResource>
Resource.isEditable()
protected String getPath(LayeredResource resource)
getPath
in class AbstractResourceOrigin<LayeredResource>
Resource.getPath()
protected String getName(LayeredResource resource)
getName
in class AbstractResourceOrigin<LayeredResource>
Resource.getName()
protected long getLastModified(LayeredResource resource)
getLastModified
in class AbstractResourceOrigin<LayeredResource>
Resource.getLastModified()
protected List<LayeredResource> listChildren(LayeredResource resource)
listChildren
in class AbstractResourceOrigin<LayeredResource>
Resource.listChildren()
protected LayeredResource getParent(LayeredResource resource)
getParent
in class AbstractResourceOrigin<LayeredResource>
Resource.getParent()
protected InputStream doOpenStream(LayeredResource resource) throws IOException
doOpenStream
in class AbstractResourceOrigin<LayeredResource>
IOException
protected Reader openReader(LayeredResource resource) throws IOException
openReader
in class AbstractResourceOrigin<LayeredResource>
IOException
Resource.openReader()
protected Charset getCharsetFor(LayeredResource resource)
openReader(LayeredResource)
,
this method used in AbstractResourceOrigin.openReader(info.magnolia.resourceloader.AbstractResource)
should never be called.getCharsetFor
in class AbstractResourceOrigin<LayeredResource>
protected LayeredResource newLayeredResource(List<Resource> resources)
Copyright © 2003–2016 Magnolia International Ltd.. All rights reserved.