public class ResourceUtils extends Object
Constructor and Description |
---|
ResourceUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getResourceVersion(org.springframework.core.io.Resource resource)
Extracts the version from the resource.
|
static String |
getResourceWithoutVersion(org.springframework.core.io.Resource resource)
Extracts the string representing the resource with the version number extracted.
|
static String |
getUrlResourceVersion(org.springframework.core.io.UrlResource urlResource)
Parse the version number from a
UrlResource . |
static String |
getUrlResourceWithoutVersion(org.springframework.core.io.UrlResource urlResource) |
public static String getUrlResourceVersion(org.springframework.core.io.UrlResource urlResource)
UrlResource
. It can match a simple
<artifactId>-<version>.jar
formatted name. For example, a resource ending in
file-sink-rabbit-1.2.0.RELEASE.jar
will return 1.2.0.RELEASE
. Snapshot
builds of the form file-sink-rabbit-1.2.0.BUILD-SNAPSHOT.jar
and
file-sink-rabbit-1.2.0-SNAPSHOT.jar
are also supportedurlResource
- public static String getUrlResourceWithoutVersion(org.springframework.core.io.UrlResource urlResource)
public static String getResourceVersion(org.springframework.core.io.Resource resource)
MavenResource
, DockerResource
, and UrlResource
. @param resource to be
used. @return the version the resource. @throwspublic static String getResourceWithoutVersion(org.springframework.core.io.Resource resource)
resource
- to be used.Copyright © 2017 Pivotal Software, Inc.. All rights reserved.