private Calendar getLastModified(ResourceResolver resourceResolver, String pageContentPath) { Resource pageContent = resourceResolver.getResource(pageContentPath); Calendar lastModified = null; if (resource != null) { lastModified = pageContent.getValueMap().get(NameConstants.PN_PAGE_LAST_MOD, Calendar.class); } return lastModified; }
/** * * @return the parent resource (might be a {@link NonExistingResource} in case the parent does not exist either). */ public Resource getParent() { Resource parent = super.getParent(); if (parent == null) { return new NonExistingResource(getResourceResolver(), ResourceUtil.getParent(getPath())); } else { return parent; } }
/** * Returns the value of calling <code>adaptTo</code> on the * {@link #getResource() wrapped resource}. */ @Override public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) { return getResource().adaptTo(type); }
private boolean isTransient(ResourceResolver resourceResolver, String workflowModelId) { Resource resource = resourceResolver.getResource(workflowModelId).getParent(); return resource.getValueMap().get("transient", false); } }
public Parameters(Resource resource) { final ValueMap properties = resource.getValueMap(); customProperties = properties.get(CUSTOM_PROPERTIES, new String[]{}); groups = properties.get(GROUPS, new String[]{}); groupFilter = properties.get(GROUP_FILTER, GROUP_FILTER_BOTH); }
/** * Returns the value of calling <code>getPath</code> on the * {@link #getResource() wrapped resource}. */ @Override public String getPath() { return getResource().getPath(); }
/** * Returns the value of calling <code>getResourceResolver</code> on the * {@link #getResource() wrapped resource}. */ @Override public ResourceResolver getResourceResolver() { return getResource().getResourceResolver(); }
/** * Returns the value of calling <code>getResourceType</code> on the * {@link #getResource() wrapped resource}. */ @Override public String getResourceType() { return getResource().getResourceType(); }
/** * Returns the value of calling <code>getName</code> on the * {@link #getResource() wrapped resource}. * * @since 2.1.0 (Sling API Bundle 2.1.0) */ @Override public String getName() { return getResource().getName(); }
/** * Returns the value of calling <code>getChild</code> on the * {@link #getResource() wrapped resource}. * * @since 2.1.0 (Sling API Bundle 2.1.0) */ @Override public Resource getChild(String relPath) { return getResource().getChild(relPath); }
/** * @see org.apache.sling.api.resource.Resource#getValueMap() */ @Override public ValueMap getValueMap() { return getResource().getValueMap(); }
/** * Visit the given resource and all its descendants. * @param res The resource */ public void accept(final Resource res) { if (res != null) { this.visit(res); this.traverseChildren(res.listChildren()); } }
/** * Returns the value of calling <code>getParent</code> on the * {@link #getResource() wrapped resource}. * * @since 2.1.0 (Sling API Bundle 2.1.0) */ @Override public Resource getParent() { return getResource().getParent(); }
/** * @see org.apache.sling.api.resource.Resource#getChildren() */ @Override public Iterable<Resource> getChildren() { return getResource().getChildren(); }
/** * Returns the value of calling <code>getResourceSuperType</code> on the * {@link #getResource() wrapped resource}. */ @Override public String getResourceSuperType() { return getResource().getResourceSuperType(); }
/** * Returns the value of calling <code>hasChildren</code> on the * {@link #getResource() wrapped resource}. * * @since 2.4.4 (Sling API Bundle 2.5.0) */ @Override public boolean hasChildren() { return getResource().hasChildren(); }
/** * Returns <code>true</code> if this resource is of the given resource type * or if any of the super resource types equals the given resource type. * <p> * This method delegates to {@link ResourceResolver#isResourceType(Resource, String)} */ public boolean isResourceType(final String resourceType) { return this.getResourceResolver().isResourceType(this, resourceType); }
/** * Returns the parent resource of this resource. * <p> * This method is implemented calling the {@link ResourceResolver#getParent(Resource)} method. */ public Resource getParent() { return getResourceResolver().getParent(this); }
/** * Checks to see if there are direct children of this resource by invoking * {@link ResourceResolver#hasChildren(Resource)}. */ public boolean hasChildren() { return getResourceResolver().hasChildren(this); }
private boolean isTransient(ResourceResolver resourceResolver, String workflowModelId) { Resource resource = resourceResolver.getResource(workflowModelId).getParent(); return resource.getValueMap().get("transient", false); } }