public class PackageId extends java.lang.Object implements java.lang.Comparable<PackageId>
PackageId provides the basic metrics for identifying a package.
A package id consists of a group id, a name and a version.
the group is a relative path, eg: "company/project/subgroup", the name and the version
can be of any format.| Modifier and Type | Field and Description |
|---|---|
static PackageId[] |
EMPTY |
static java.lang.String |
ETC_PACKAGES |
static java.lang.String |
ETC_PACKAGES_PREFIX |
| Constructor and Description |
|---|
PackageId(java.lang.String path)
Creates a new package id
|
PackageId(java.lang.String path,
java.lang.String version)
Creates a new package id
|
PackageId(java.lang.String group,
java.lang.String name,
java.lang.String version)
Creates a new package id
|
PackageId(java.lang.String group,
java.lang.String name,
Version version)
Creates a new package id
|
PackageId(java.lang.String path,
Version version)
Creates a new package id
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(PackageId o)
Compares this id with the given one.
|
boolean |
equals(java.lang.Object o) |
static PackageId[] |
fromString(java.lang.String... str)
Returns an array of package id from strings
|
static PackageId |
fromString(java.lang.String str)
Returns a package id from a id string.
|
java.lang.String |
getDownloadName()
Returns a download name in the form
name [ "-" version ] ".zip" |
java.lang.String |
getGroup()
Returns the group id of this package
|
java.lang.String |
getInstallationPath()
Returns the path of this package.
|
java.lang.String |
getName()
Returns the name of this package which is the last segment of the path.
|
Version |
getVersion()
Returns the version of this package or
null if n/a. |
java.lang.String |
getVersionString()
Returns the version of this package or and empty string if n/a.
|
int |
hashCode() |
boolean |
isFromPath()
Checks if this definition was constructed from a path, rather from a
group and name.
|
boolean |
isValid()
Checks if this package id is valid in respect to JCR names.
|
static boolean |
isValid(java.lang.String group,
java.lang.String name,
java.lang.String version)
Checks if the package id is valid in respect to JCR names.
|
java.lang.String |
toString()
Returns a string representation of this id
|
static java.lang.String |
toString(PackageId... packs)
Creates a comma separated list of id strings.
|
public static final java.lang.String ETC_PACKAGES
public static final java.lang.String ETC_PACKAGES_PREFIX
public static final PackageId[] EMPTY
public PackageId(java.lang.String path)
path - path of the packagepublic PackageId(java.lang.String path,
java.lang.String version)
path - path of the packageversion - version of the packagepublic PackageId(java.lang.String path,
Version version)
path - path of the packageversion - version of the packagepublic PackageId(java.lang.String group,
java.lang.String name,
java.lang.String version)
group - group idname - nameversion - versionpublic PackageId(java.lang.String group,
java.lang.String name,
Version version)
group - group idname - nameversion - versionpublic static PackageId fromString(java.lang.String str)
null is returned.str - the stringpublic static PackageId[] fromString(java.lang.String... str)
str - the stringspublic static java.lang.String toString(PackageId... packs)
packs - the idspublic boolean isFromPath()
true if constructed from path.public java.lang.String getInstallationPath()
public java.lang.String getGroup()
public java.lang.String getName()
public java.lang.String getVersionString()
public java.lang.String getDownloadName()
name [ "-" version ] ".zip"public Version getVersion()
null if n/a.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(PackageId o)
compareTo in interface java.lang.Comparable<PackageId>public boolean isValid()
true if the names are validpublic static boolean isValid(java.lang.String group,
java.lang.String name,
java.lang.String version)
group - the package group namename - the package nameversion - the (optional) versiontrue if the names are valid"Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"