Class PackageId
- java.lang.Object
-
- org.apache.jackrabbit.vault.packaging.PackageId
-
- All Implemented Interfaces:
Comparable<PackageId>
public class PackageId extends Object implements 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.
-
-
Field Summary
Fields Modifier and Type Field Description static PackageId[]
EMPTY
static String
ETC_PACKAGES
Deprecated.As of 3.1.42, the storage location is implementation details.static String
ETC_PACKAGES_PREFIX
Deprecated.As of 3.1.42, the storage location is implementation details.
-
Constructor Summary
Constructors Constructor Description PackageId(String path)
Deprecated.As of 3.1.42, the storage location is implementation details.PackageId(String path, String version)
Deprecated.As of 3.1.42, the storage location is implementation details.PackageId(String group, String name, String version)
Creates a new package idPackageId(String group, String name, Version version)
Creates a new package idPackageId(String path, Version version)
Deprecated.As of 3.1.42, the storage location is implementation details.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compareTo(PackageId o)
Compares this id with the given one.boolean
equals(Object o)
static PackageId
fromString(String str)
Returns a package id from a id string.static PackageId[]
fromString(String... str)
Returns an array of package id from stringsString
getDownloadName()
Returns a download name in the formname [ "-" version ] ".zip"
String
getGroup()
Returns the group id of this packageString
getInstallationPath()
Deprecated.As of 3.1.42, the storage location is implementation details.String
getName()
Returns the name of this package which is the last segment of the path.Version
getVersion()
Returns the version of this package ornull
if n/a.String
getVersionString()
Returns the version of this package or and empty string if n/a.int
hashCode()
boolean
isFromPath()
Deprecated.As of 3.1.42, the storage location is implementation details.boolean
isValid()
Checks if this package id is valid in respect to JCR names.static boolean
isValid(String group, String name, String version)
Checks if the package id is valid in respect to JCR names.String
toString()
Returns a string representation of this idstatic String
toString(PackageId... packs)
Creates a comma separated list of id strings.
-
-
-
Field Detail
-
ETC_PACKAGES
@Deprecated public static final String ETC_PACKAGES
Deprecated.As of 3.1.42, the storage location is implementation details.The root path of the packages storage location.- See Also:
- Constant Field Values
-
ETC_PACKAGES_PREFIX
@Deprecated public static final String 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:
- Constant Field Values
-
EMPTY
public static final PackageId[] EMPTY
-
-
Constructor Detail
-
PackageId
@Deprecated public PackageId(String path)
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 public PackageId(String path, String version)
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 public PackageId(String path, Version version)
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
public PackageId(String group, String name, String version)
Creates a new package id- Parameters:
group
- group idname
- nameversion
- version
-
-
Method Detail
-
fromString
public static PackageId fromString(String str)
Returns a package id from a id string. if the given id is null or an empty string,null
is returned.- Parameters:
str
- the string- Returns:
- the package id
-
fromString
public static PackageId[] fromString(String... str)
Returns an array of package id from strings- Parameters:
str
- the strings- Returns:
- the array of package ids
-
toString
public static String toString(PackageId... packs)
Creates a comma separated list of id strings.- Parameters:
packs
- the ids- Returns:
- the string
-
isFromPath
@Deprecated public boolean 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:
true
if constructed from path.- Since:
- 2.2.26
-
getInstallationPath
@Deprecated public String 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
public String getGroup()
Returns the group id of this package- Returns:
- the group id;
- Since:
- 2.2
-
getName
public String getName()
Returns the name of this package which is the last segment of the path.- Returns:
- the name of this package.
-
getVersionString
public String getVersionString()
Returns the version of this package or and empty string if n/a.- Returns:
- the version of this package
- Since:
- 2.0
-
getDownloadName
public String getDownloadName()
Returns a download name in the formname [ "-" version ] ".zip"
- Returns:
- the download name
- Since:
- 2.0
-
getVersion
public Version getVersion()
Returns the version of this package ornull
if n/a.- Returns:
- the version of this package
-
toString
public String toString()
Returns a string representation of this id
-
compareTo
public int compareTo(PackageId o)
Compares this id with the given one.- Specified by:
compareTo
in interfaceComparable<PackageId>
-
isValid
public boolean isValid()
Checks if this package id is valid in respect to JCR names.- Returns:
true
if the names are valid
-
-