Class LinkedResources

java.lang.Object
com.adobe.epubcheck.opf.LinkedResources

public final class LinkedResources extends Object
Represents a set of linked resources (i.e. resources defined by link elements in a Package Document), with predictable iteration order.
  • Field Details

  • Constructor Details

  • Method Details

    • getById

      public com.google.common.base.Optional<LinkedResource> getById(String id)
      Search the linked resource with the given ID.
      Parameters:
      id - the ID of the resource to search, can be null.
      Returns:
      An Optional containing the linked resource if found, or Optional.absent() if not found.
    • getByURL

      public List<LinkedResource> getByURL(io.mola.galimatias.URL url)
      Search the linked resource with the given URL. All resource whose href URL minus fragment is equal to the given URL are returned, in document order.
      Parameters:
      url - the URL (without fragment) of the resource to search, can be null.
      Returns:
      A list of linked resources referencing the resource at url or a fragment thereof ; an empty list is returned if no such resource is found.
    • asList

      public List<LinkedResource> asList()
      Returns the list of all linked resources in this set, in document order.
      Returns:
      the list of all linked resources in this set.
    • hasResource

      public boolean hasResource(io.mola.galimatias.URL url)
      Returns true if this set contains a linked resource referencing the given resource (or fragment thereof).
    • builder

      public static LinkedResources.Builder builder()
      Creates a new builder. Calling this method is identical to calling the empty LinkedResources.Builder constructor.
      Returns:
      a newly created builder.