Class Copier

All Implemented Interfaces:
Generator, Renamable, ResourceProvider

public class Copier extends AbstractGenerator
The Class Copier.
  • Constructor Details

    • Copier

      public Copier(Project project)
      Initializes a new copier.
      Parameters:
      project - the project
  • Method Details

    • source

      public Copier source(Stream<Copier.Source> sources)
      Add the given Stream of Sources to the source resources.
      Parameters:
      sources - the sources
      Returns:
      the copier
    • source

      public Copier source(Path root, String pattern)
      Convenience method to add a FileTree without subdirectory or filter to the sources. If root is a relative path, it is resolved against the project's directory.
      Parameters:
      root - the root
      pattern - the pattern
      Returns:
      the copier
    • into

      public Copier into(Path destination)
      Sets the destination directory for the copied resources. If the destination is relative, it is resolved against the project's directory.
      Parameters:
      destination - the destination
      Returns:
      the copier
    • provideResources

      Provide the generated resources in response to a request like the given one.
      Parameters:
      proto - defines the kind of request that the copier should respond to with the copied resources
      Returns:
      the copier
    • doProvide

      protected <T extends Resource> Stream<T> doProvide(ResourceRequest<T> request)
      Description copied from class: AbstractProvider
      Invoked by ResourceProviderSpi.provide(ResourceRequest) after checking if the invocation is allowed.
      Specified by:
      doProvide in class AbstractProvider
      Type Parameters:
      T - the generic type
      Parameters:
      request - the request for resources
      Returns:
      the stream