Class ResourceHelper

java.lang.Object
org.ametys.web.explorer.ResourceHelper

public final class ResourceHelper extends Object
Helper methods related to Resources and ResourceCollections.
  • Field Details

  • Method Details

    • isShared

      public static final boolean isShared(Resource resource)
      Test if a resource belongs to a shared tree.
      Parameters:
      resource - the resource to test.
      Returns:
      true if the resource belongs to a shared tree, false otherwise.
    • isShared

      public static final boolean isShared(ResourceCollection collection)
      Test if a resource collection belongs to a shared tree.
      Parameters:
      collection - the resource collection to test.
      Returns:
      true if the resource collection belongs to a shared tree, false otherwise.
    • isShared

      public static final boolean isShared(ExplorerNode explorerNode)
      Test if an explorer node belongs to a shared tree.
      Parameters:
      explorerNode - the explorer node to test.
      Returns:
      true if the explorer node belongs to a shared tree, false otherwise.
    • isShared

      public static final boolean isShared(String objectPath)
      Test if a resource or resource collection belongs to a shared tree.
      Parameters:
      objectPath - the path of the resource or resource collection AmetysObject.
      Returns:
      true if the resource belongs to a shared tree, false otherwise.
    • getSharedRootName

      public static final String getSharedRootName(Resource resource)
      Get the shared root name of a shared resource.
      Parameters:
      resource - the resource.
      Returns:
      the shared root name of the resource, or null if the resource is not shared.
    • getSharedRootName

      public static final String getSharedRootName(ResourceCollection collection)
      Get the shared root name of a shared resource collection.
      Parameters:
      collection - the resource collection.
      Returns:
      the shared root name of the resource collection, or null if the collection is not shared.
    • getSharedRootName

      public static final String getSharedRootName(ExplorerNode explorerNode)
      Get the shared root name of a shared explorer node.
      Parameters:
      explorerNode - the explorer node.
      Returns:
      the shared root name of the explorer node, or null if the node is not shared.
    • getSharedRootName

      public static final String getSharedRootName(String objectPath)
      Get the shared root name of a shared resource or collection
      Parameters:
      objectPath - the path of the resource or collection AmetysObject.
      Returns:
      the shared root name of the resource, or null if the resource is not shared.
    • getRightsContext

      public static final String getRightsContext(ExplorerNode explorerNode)
      Get the rights context of an explorer node.
      Parameters:
      explorerNode - the explorer node.
      Returns:
      the explorer node rights context.
    • getRightsContext

      public static final String getRightsContext(String objectPath, String resourcePath)
      Get the rights context of a resource.
      Parameters:
      objectPath - the path of the resource or collection AmetysObject.
      resourcePath - the path of the resource in the resource explorer.
      Returns:
      the resource rights context.