public class JcrResourceOrigin extends AbstractResourceOrigin<JcrResource>
ResourceOrigin
which loads resources from JCR.ResourceOrigin.ResourceNotFoundException
Modifier and Type | Field and Description |
---|---|
static String |
BINARY_NODE_NAME |
static String |
BYPASS_PROPERTY |
static String |
RESOURCES_WORKSPACE |
static String |
TEXT_PROPERTY |
Modifier and Type | Method and Description |
---|---|
protected InputStream |
doOpenStream(JcrResource resource) |
protected javax.jcr.Binary |
getBinary(javax.jcr.Node resourceNode) |
JcrResource |
getByPath(String path)
Retrieves a
Resource object based on the given path. |
protected Charset |
getCharsetFor(JcrResource resource)
|
protected javax.jcr.Session |
getJcrSession() |
protected long |
getLastModified(JcrResource resource) |
protected String |
getName(JcrResource resource) |
protected JcrResource |
getParent(JcrResource resource) |
protected String |
getPath(JcrResource resource) |
JcrResource |
getRoot()
Returns the
Resource for this origin's declared root. |
boolean |
hasPath(String path) |
protected boolean |
isBinaryResource(javax.jcr.Node node) |
protected boolean |
isBypassed(javax.jcr.Node node) |
protected boolean |
isDirectory(JcrResource resource) |
protected boolean |
isDirectory(javax.jcr.Node node) |
protected boolean |
isEditable(JcrResource resource) |
protected boolean |
isFile(JcrResource resource) |
protected boolean |
isFile(javax.jcr.Node node) |
protected boolean |
isResource(javax.jcr.Node node) |
protected boolean |
isTextResource(javax.jcr.Node resourceNode) |
protected List<JcrResource> |
listChildren(JcrResource resource) |
protected JcrResource |
newResource(javax.jcr.Node node) |
protected Reader |
openReader(JcrResource resource) |
void |
watchForChanges(ResourceVisitor visitor)
Sets up observation for this origin, and hooks it to the given callback
ResourceVisitor . |
getName, openStream, traverseWith
public static final String RESOURCES_WORKSPACE
public static final String BINARY_NODE_NAME
public static final String TEXT_PROPERTY
public static final String BYPASS_PROPERTY
public void watchForChanges(ResourceVisitor visitor)
ResourceOrigin
ResourceVisitor
.ResourceVisitor
,
PredicatedResourceVisitor
public JcrResource getRoot()
ResourceOrigin
Resource
for this origin's declared root.public JcrResource 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(JcrResource resource)
isFile
in class AbstractResourceOrigin<JcrResource>
Resource.isFile()
protected boolean isDirectory(JcrResource resource)
isDirectory
in class AbstractResourceOrigin<JcrResource>
Resource.isDirectory()
protected boolean isEditable(JcrResource resource)
isEditable
in class AbstractResourceOrigin<JcrResource>
Resource.isEditable()
protected String getPath(JcrResource resource)
getPath
in class AbstractResourceOrigin<JcrResource>
Resource.getPath()
protected String getName(JcrResource resource)
getName
in class AbstractResourceOrigin<JcrResource>
Resource.getName()
protected long getLastModified(JcrResource resource)
getLastModified
in class AbstractResourceOrigin<JcrResource>
Resource.getLastModified()
protected List<JcrResource> listChildren(JcrResource resource)
listChildren
in class AbstractResourceOrigin<JcrResource>
Resource.listChildren()
protected JcrResource getParent(JcrResource resource)
getParent
in class AbstractResourceOrigin<JcrResource>
Resource.getParent()
protected Reader openReader(JcrResource resource) throws IOException
openReader
in class AbstractResourceOrigin<JcrResource>
IOException
Resource.openReader()
protected InputStream doOpenStream(JcrResource resource)
doOpenStream
in class AbstractResourceOrigin<JcrResource>
protected Charset getCharsetFor(JcrResource resource)
AbstractResourceOrigin
getCharsetFor
in class AbstractResourceOrigin<JcrResource>
protected JcrResource newResource(javax.jcr.Node node)
protected javax.jcr.Session getJcrSession() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected boolean isResource(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected javax.jcr.Binary getBinary(javax.jcr.Node resourceNode) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected boolean isTextResource(javax.jcr.Node resourceNode) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected boolean isBinaryResource(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected boolean isFile(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected boolean isDirectory(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected boolean isBypassed(javax.jcr.Node node)
Copyright © 2003–2015 Magnolia International Ltd.. All rights reserved.