public class Fmri extends java.lang.Object implements java.lang.Comparable<Fmri>, java.lang.Cloneable
Fmri
is an identifier for a package.
The acronym stands for Fault Management Resource Identifier (even though
IPS has little to do with
fault management). The Fmri includes the name and version for the package.
For more information about the format and behavior of the version part of the
Fmri, see the Version
class.Version
Modifier and Type | Field and Description |
---|---|
static Fmri |
nullFmri |
static java.lang.String |
PREF_AUTH_PFX |
Constructor and Description |
---|
Fmri(java.lang.String p)
Create an Fmri from a string representation.
|
Fmri(java.lang.String name,
java.lang.String version)
Create an Fmri from a package name and version.
|
Modifier and Type | Method and Description |
---|---|
Fmri |
clone() |
int |
compareTo(Fmri fmri)
Compare two Fmris.
|
boolean |
equals(java.lang.Object o)
Compare to Fmris for equality.
|
java.lang.String |
getAuthority()
Obtain the authority from the Fmri.
|
java.lang.String |
getName()
Obtain the name of the package
|
java.io.File |
getPkgDir(java.io.File pkgdir)
Return the directory that is used to store information about all versions
of this package
|
java.io.File |
getPkgVersionDir(java.io.File pkgdir)
Return the directory that is used to store information about this particular
package version.
|
java.lang.String |
getURLPath()
Return the URL path that is used to look up information about this Fmri.
|
Version |
getVersion()
Obtain the version of the package
|
int |
hashCode() |
boolean |
isSamePackage(Fmri f)
Determine whether the given Fmri is for the same package as this Fmri,
even if for different versions.
|
boolean |
isSuccessor(Fmri f)
Determine whether this Fmri is a successor to the given Fmri
|
boolean |
matches(Fmri f)
Check if the given Fmri matches this Fmri.
|
java.lang.String |
toString()
Return the String representation of the Fmri.
|
public static final java.lang.String PREF_AUTH_PFX
public static final Fmri nullFmri
public Fmri(java.lang.String p)
public Fmri(java.lang.String name, java.lang.String version)
public Fmri clone()
clone
in class java.lang.Object
public java.lang.String getAuthority()
public java.lang.String getName()
public Version getVersion()
public java.io.File getPkgDir(java.io.File pkgdir) throws java.io.IOException
pkgdir
- The directory within the image for storing all package meta datajava.io.IOException
public java.io.File getPkgVersionDir(java.io.File pkgdir) throws java.io.IOException
pkgdir
- The directory within the image for storing all package meta datajava.io.IOException
public java.lang.String getURLPath() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(Fmri fmri)
compareTo
in interface java.lang.Comparable<Fmri>
fmri
- the Fmri to compare with this Fmripublic boolean matches(Fmri f)
public boolean isSamePackage(Fmri f)
f
- a given Fmripublic boolean isSuccessor(Fmri f)
f
- the given Fmri