Interface MergedResourcePicker2


  • @ConsumerType
    public interface MergedResourcePicker2
    Service interface which can be implemented to define an algorithm used to pick resources to be merged. For each picker service, a separate ResourceProvider will be exposed at the MERGE_ROOT of the picker.
    Since:
    1.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String MERGE_ROOT
      Service property name identifying the root path for the merged resources.
      static java.lang.String READ_ONLY
      Service property name specifying whether the resources are read-only or support CRUD operations.
      static java.lang.String TRAVERSE_PARENT
      Service property name specifying whether the parent hierarchy is traversed to check for hiding properties.
    • Field Detail

      • MERGE_ROOT

        static final java.lang.String MERGE_ROOT
        Service property name identifying the root path for the merged resources. By convention, starts, with /mnt, although this is by no means required. The value of this service property must be of type String and must not end in a slash.
        See Also:
        Constant Field Values
      • READ_ONLY

        static final java.lang.String READ_ONLY
        Service property name specifying whether the resources are read-only or support CRUD operations. If not specified this property defaults to true. The value of this property must be of type Boolean.
        See Also:
        Constant Field Values
      • TRAVERSE_PARENT

        static final java.lang.String TRAVERSE_PARENT
        Service property name specifying whether the parent hierarchy is traversed to check for hiding properties. If not specified this property defaults to false. The value of this property must be of type Boolean.
        See Also:
        Constant Field Values
    • Method Detail

      • pickResources

        @NotNull
        @NotNull java.util.List<@NotNull Resource> pickResources​(@NotNull
                                                                 @NotNull ResourceResolver resolver,
                                                                 @NotNull
                                                                 @NotNull java.lang.String relativePath,
                                                                 Resource relatedResource)
        Method invoked by the MergingResourceProvider to identify the resources to be merged for a given relative path. The resources returned may be either resources returned from the ResourceResolver directory or an instance of NonExistingResource. Returning an empty list will cause the resource to not exist for consumers (resolver.getResource(path) will return null).
        Parameters:
        resolver - the ResourceResolver
        relativePath - the path relative to the merge root
        relatedResource - an optional resource which is related to the given path (always the parent resource or null)
        Returns:
        a List of Resource objects