Class ResourceContext

java.lang.Object
ac.simons.neo4j.migrations.core.ResourceContext

public final class ResourceContext extends Object
A context in which a resource with a given URL was discovered.
Since:
1.7.0
Author:
Michael J. Simons
  • Method Details

    • of

      public static ResourceContext of(URL url, MigrationsConfig config)
      Static factory method, might be helpful during tests of additional providers
      Parameters:
      url - The url of the given resource
      config - The config used during discovery
      Returns:
      A new resource context
    • getUrl

      public URL getUrl()
      Returns:
      the resources URL
    • getIdentifier

      public String getIdentifier()
      Returns:
      The identifier of the underlying resource
      Since:
      1.8.0
    • getConfig

      public MigrationsConfig getConfig()
      Returns:
      the configuration with which the resource has been discovered
    • openStream

      public InputStream openStream()
      This method tries to get an InputStream from a URL. If this URL points to something on the classpath, it tries to handle the changes introduced in Spring Boot 3.2.0 about how nested JARs are handle, see Nested Jar Support. This affects Cypher as well as XML based resources.
      Returns:
      an InputStream. The caller is supposed to properly close the stream.
      Since:
      2.9.2