Class AppResourceCommon

java.lang.Object
org.springframework.cloud.dataflow.registry.support.AppResourceCommon

public class AppResourceCommon extends Object
Author:
Christian Tzolov, Ilayaperumal Gopinathan, David Turanski
  • Constructor Details

    • AppResourceCommon

      public AppResourceCommon(org.springframework.cloud.deployer.resource.maven.MavenProperties mavenProperties, ResourceLoader resourceLoader)
  • Method Details

    • getResourceVersion

      public String getResourceVersion(Resource resource)
      Extracts the version from the resource. Supported resource types are MavenResource, DockerResource, and UrlResource.
      Parameters:
      resource - the resource to use.
      Returns:
      the version the resource.
    • getResource

      public Resource getResource(String resourceUri)
      Retrieve the corresponding Resource 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

      public String getResourceWithoutVersion(Resource resource)
      Returns a string representing the resource with version subtracted
      Parameters:
      resource - to be represented as string.
      Returns:
      String representation of the resource.
    • getMetadataResource

      public Resource getMetadataResource(URI appUri, URI metadataUri)
      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 URI
      metadataUri - 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