Package ac.simons.neo4j.migrations.core
Class ResourceContext
java.lang.Object
ac.simons.neo4j.migrations.core.ResourceContext
A context in which a resource with a given URL was discovered.
- Since:
- 1.7.0
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptiongetUrl()
static ResourceContext
of
(URL url, MigrationsConfig config) Static factory method, might be helpful during tests of additional providersThis method tries to get anInputStream
from aURL
.
-
Method Details
-
of
Static factory method, might be helpful during tests of additional providers- Parameters:
url
- The url of the given resourceconfig
- The config used during discovery- Returns:
- A new resource context
-
getUrl
- Returns:
- the resources
URL
-
getIdentifier
- Returns:
- The identifier of the underlying resource
- Since:
- 1.8.0
-
getConfig
- Returns:
- the configuration with which the resource has been discovered
-
openStream
This method tries to get anInputStream
from aURL
. 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
-