Class AppResourceCommon
java.lang.Object
org.springframework.cloud.dataflow.registry.support.AppResourceCommon
- Author:
- Christian Tzolov, Ilayaperumal Gopinathan, David Turanski
-
Constructor Summary
ConstructorDescriptionAppResourceCommon
(org.springframework.cloud.deployer.resource.maven.MavenProperties mavenProperties, ResourceLoader resourceLoader) -
Method Summary
Modifier and TypeMethodDescriptiongetMetadataResource
(URI appUri, URI metadataUri) Resolves the metadata resource if provided or falls back to the apps resources otherwise.getResource
(String resourceUri) Retrieve the correspondingResource
instance based on the URI String.getResourceVersion
(Resource resource) Extracts the version from the resource.getResourceWithoutVersion
(Resource resource) Returns a string representing the resource with version subtracted
-
Constructor Details
-
AppResourceCommon
public AppResourceCommon(org.springframework.cloud.deployer.resource.maven.MavenProperties mavenProperties, ResourceLoader resourceLoader)
-
-
Method Details
-
getResourceVersion
Extracts the version from the resource. Supported resource types are MavenResource,DockerResource
, andUrlResource
.- Parameters:
resource
- the resource to use.- Returns:
- the version the resource.
-
getResource
Retrieve the correspondingResource
instance based on the URI String. Maven properties are used if the URI corresponds to maven resource.- Parameters:
resourceUri
- String representation of the resource URI- Returns:
- the resource instance
-
getResourceWithoutVersion
Returns a string representing the resource with version subtracted- Parameters:
resource
- to be represented as string.- Returns:
- String representation of the resource.
-
getMetadataResource
Resolves the metadata resource if provided or falls back to the apps resources otherwise. For Docker app resource types returns null- Parameters:
appUri
- the App Resource URI to fall back to in case of missing metadata URImetadataUri
- Metadata resource URI- Returns:
- If metadata URI is not empty returns the Metadata resource. For empty metadataUri returns the App Resource or null in case of Docker
-