Class PackageId
java.lang.Object
org.apache.jackrabbit.vault.packaging.PackageId
- All Implemented Interfaces:
Comparable<PackageId>
PackageId provides the basic metrics for identifying a package.
A package id consists of a group, a name and an optional version.
The group is a relative path, eg: "company/project/subgroup", the name and the version
can be of any format.
The string representation is <group>:<name>[:<version>].
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.As of 3.1.42, the storage location is implementation details.Deprecated.As of 3.1.42, the storage location is implementation details.Creates a new package idCreates a new package idDeprecated.As of 3.1.42, the storage location is implementation details. -
Method Summary
Modifier and TypeMethodDescriptionintCompares this id with the given one.booleanstatic PackageIdfromString(String str) Returns a package id from an id string in the format<group>:<name>[:<version>].static PackageId[]fromString(String... str) Returns an array of package id from strings.Returns a download name in the formname [ "-" version ] ".zip"getGroup()Returns the group of this packageDeprecated.As of 3.1.42, the storage location is implementation details.@NotNull StringgetName()Returns the name of this package (usually this is the last segment of the path).@NotNull VersionReturns the version of this package orVersion.EMPTYif not set.@NotNull StringReturns the version of this package or and empty string if n/a.inthashCode()booleanDeprecated.As of 3.1.42, the storage location is implementation details.booleanisValid()Checks if this package id is valid in respect to JCR names.static booleanChecks if the package id is valid in respect to JCR names.toString()Returns a string representation of this id in the format<group>:<name>[:<version>].static StringCreates a comma separated list of id strings in the format<group>:<name>[:<version>].
-
Field Details
-
ETC_PACKAGES
Deprecated.As of 3.1.42, the storage location is implementation details.The root path of the packages storage location.- See Also:
-
ETC_PACKAGES_PREFIX
Deprecated.As of 3.1.42, the storage location is implementation details.The root path prefix of the packages storage location.- See Also:
-
EMPTY
-
-
Constructor Details
-
PackageId
Deprecated.As of 3.1.42, the storage location is implementation details.Creates a new package id- Parameters:
path- path of the package
-
PackageId
Deprecated.As of 3.1.42, the storage location is implementation details.Creates a new package id- Parameters:
path- path of the packageversion- version of the package
-
PackageId
Deprecated.As of 3.1.42, the storage location is implementation details.Creates a new package id- Parameters:
path- path of the packageversion- version of the package
-
PackageId
Creates a new package id- Parameters:
group- group idname- nameversion- version
-
PackageId
Creates a new package id- Parameters:
group- group idname- nameversion- version
-
-
Method Details
-
fromString
Returns a package id from an id string in the format<group>:<name>[:<version>]. If the given id is null or an empty string,nullis returned.- Parameters:
str- the string- Returns:
- the package id
-
fromString
Returns an array of package id from strings.- Parameters:
str- the strings- Returns:
- the array of package ids
- See Also:
-
toString
Creates a comma separated list of id strings in the format<group>:<name>[:<version>].- Parameters:
packs- the ids- Returns:
- the string
-
isFromPath
Deprecated.As of 3.1.42, the storage location is implementation details.Checks if this definition was constructed from a path, rather from a group and name.- Returns:
trueif constructed from path.- Since:
- 2.2.26
-
getInstallationPath
Deprecated.As of 3.1.42, the storage location is implementation details.Returns the path of this package. please note that since 2.3 this also includes the version, but never the extension (.zip).- Returns:
- the path of this package
- Since:
- 2.2
-
getGroup
Returns the group of this package- Returns:
- the group.
- Since:
- 2.2
-
getName
Returns the name of this package (usually this is the last segment of the path).- Returns:
- the name of this package.
-
getVersionString
Returns the version of this package or and empty string if n/a.- Returns:
- the version of this package
- Since:
- 2.0
-
getDownloadName
Returns a download name in the formname [ "-" version ] ".zip"- Returns:
- the download name
- Since:
- 2.0
-
getVersion
Returns the version of this package orVersion.EMPTYif not set.- Returns:
- the version of this package
-
toString
Returns a string representation of this id in the format<group>:<name>[:<version>]. -
equals
-
hashCode
public int hashCode() -
compareTo
Compares this id with the given one.- Specified by:
compareToin interfaceComparable<PackageId>
-
isValid
public boolean isValid()Checks if this package id is valid in respect to JCR names.- Returns:
trueif the names are valid
-
isValid
Checks if the package id is valid in respect to JCR names.- Parameters:
group- the package group namename- the package nameversion- the (optional) version- Returns:
trueif the names are valid
-