org.springframework.cloud.dataflow.registry.support

## 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 Summary

    Constructors
    Constructor and Description
    `AppResourceCommon(org.springframework.cloud.deployer.resource.maven.MavenProperties mavenProperties, org.springframework.core.io.ResourceLoader resourceLoader)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.springframework.core.io.Resource` | `getMetadataResource(URI appUri, URI metadataUri)` Resolves the metadata resource if provided or falls back to the apps resources otherwise.
    `org.springframework.core.io.Resource` | `getResource(String resourceUri)` Retrieve the corresponding `Resource` instance based on the URI String.
    `String` | `getResourceVersion(org.springframework.core.io.Resource resource)` Extracts the version from the resource.
    `String` | `getResourceWithoutVersion(org.springframework.core.io.Resource resource)` Returns a string representing the resource with version subtracted

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AppResourceCommon

          public AppResourceCommon(org.springframework.cloud.deployer.resource.maven.MavenProperties mavenProperties,
                                   org.springframework.core.io.ResourceLoader resourceLoader)

  - ### Method Detail

    - #### getResourceVersion

          public String getResourceVersion(org.springframework.core.io.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 org.springframework.core.io.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(org.springframework.core.io.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 org.springframework.core.io.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

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.