org.apache.sling.discovery.impl.common.resource
Class ResourceHelper

java.lang.Object
  extended by org.apache.sling.discovery.impl.common.resource.ResourceHelper

public class ResourceHelper
extends Object

Some helper methods surrounding resources


Constructor Summary
ResourceHelper()
           
 
Method Summary
static org.apache.sling.api.resource.Resource createResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path)
          Deprecated. use getOrCreateResource(ResourceResolver, String) instead
static boolean deleteResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path)
           
static org.apache.sling.api.resource.Resource getOrCreateResource(org.apache.sling.api.resource.ResourceResolver resourceResolver, String path)
           
static StringBuilder getPropertiesForLogging(org.apache.sling.api.resource.Resource resource)
          Compile a string builder containing the properties of a resource - used for logging
static boolean isValidPropertyName(String name)
          SLING-2883 : properly test for valid property names
static void moveResource(org.apache.sling.api.resource.Resource res, String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceHelper

public ResourceHelper()
Method Detail

getOrCreateResource

public static org.apache.sling.api.resource.Resource getOrCreateResource(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                                                         String path)
                                                                  throws org.apache.sling.api.resource.PersistenceException
Throws:
org.apache.sling.api.resource.PersistenceException

deleteResource

public static boolean deleteResource(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                     String path)
                              throws org.apache.sling.api.resource.PersistenceException
Throws:
org.apache.sling.api.resource.PersistenceException

createResource

@Deprecated
public static org.apache.sling.api.resource.Resource createResource(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                                                               String path)
                                                             throws org.apache.sling.api.resource.PersistenceException
Deprecated. use getOrCreateResource(ResourceResolver, String) instead

Throws:
org.apache.sling.api.resource.PersistenceException

getPropertiesForLogging

public static StringBuilder getPropertiesForLogging(org.apache.sling.api.resource.Resource resource)
Compile a string builder containing the properties of a resource - used for logging


moveResource

public static void moveResource(org.apache.sling.api.resource.Resource res,
                                String path)
                         throws org.apache.sling.api.resource.PersistenceException
Throws:
org.apache.sling.api.resource.PersistenceException

isValidPropertyName

public static boolean isValidPropertyName(String name)
SLING-2883 : properly test for valid property names



Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.