Interface Resource

All Known Subinterfaces:
AppJarFile, BndBaselineEvaluation, ClassFile, ClasspathElement, ClassTree, Cleanliness, EclipseConfiguration, ExecResult<T>, FileResource, FileTree<T>, IOResource, JarFile, JavadocDirectory, JavadocJarFile, JavaResourceTree, JavaSourceFile, LibraryJarFile, MvnPublication, MvnRepoBom, MvnRepoDependency, MvnRepoJarFile, MvnRepoLibraryJarFile, MvnRepoPom, MvnRepoResource, PomFile, ResourceFile, Resources<T>, SourcesJarFile, TestResult, VirtualResource, VscodeConfiguration
All Known Implementing Classes:
DefaultBndBaselineEvaluation, DefaultClassTree, DefaultEclipseConfiguration, DefaultExecResult, DefaultFileResource, DefaultFileTree, DefaultJarFile, DefaultJavaResourceTree, DefaultLibraryJarFile, DefaultMvnRepoResource, DefaultResources, DefaultTestResult, DefaultVirtualResource, JarFileEntry, ManifestAttributes, ResourceObject, ServicesEntryResource

public interface Resource
Represents a resource handled by the builder. Resources can have names that may be referenced in ResourceRequests.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Optional<Instant>
    The instant at which this resource was created or last modified.
    default String
    Returns a localized string representation of the instant at which this resource was created or last modified.
    default void
    Cleanup the resource.
    default boolean
    Checks if this resource is newer than the other.
    Returns the name of this resource if set.
    Returns the type of this resource.
  • Method Details

    • asOf

      default Optional<Instant> asOf()
      The instant at which this resource was created or last modified.
      Returns:
      the instant
    • isNewerThan

      default boolean isNewerThan(Resource other)
      Checks if this resource is newer than the other.
      Parameters:
      other - the other
      Returns:
      true, if is newer than
    • type

      Returns the type of this resource.
      Returns:
      the type
    • name

      Returns the name of this resource if set.
      Returns:
      the optional
    • cleanup

      default void cleanup()
      Cleanup the resource. This method is called by ResourceProviders in response to a request for Cleanliness. The default implementation does nothing. Derived classes should override this and delete any physical representation of the resource.
    • asOfLocalized

      default String asOfLocalized()
      Returns a localized string representation of the instant at which this resource was created or last modified.
      Returns:
      the string