org.xnap.pkg
Class PackageInfo

java.lang.Object
  extended by org.xnap.pkg.PackageInfo
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
PluginInfo

public class PackageInfo
extends java.lang.Object
implements java.lang.Comparable

This class serves as a plugin information record.


Field Summary
static java.lang.String ACTION_INSTALL
           
static java.lang.String DELIMETER
           
static java.lang.String PACKAGE_STATUS_INSTALLED
           
static java.lang.String STATUS_INSTALLED
           
static java.lang.String STATUS_NOT_INSTALLED
           
 
Constructor Summary
PackageInfo(java.util.Properties props)
          Constructs a new plugin information record from p.
 
Method Summary
 int compareTo(java.lang.Object o)
          Lower versions come first.
 int compareToVersion(PackageInfo info)
          Returns a value > 0 if the version of this package is higher than the version of info.
 int compareToVersion(java.lang.String version)
           
 boolean containsProperties(java.util.Properties p)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getAction()
          See setAction(String) for possible return values.
 java.lang.String getActionStatus()
          Returns "ok".
 java.lang.String getAuthors()
           
 java.lang.String[] getClassPath()
          Returns an empty array if no dependencies are defined.
 java.lang.String getControlPath()
           
 java.lang.String getDepends()
           
 java.lang.String getDescription()
           
 java.lang.String getDownloadFilename()
           
 java.lang.String[] getDownloadURLs()
           
 java.io.File getFile(java.lang.String filename)
          Returns a file that is relative to this packages location.
 java.lang.String getFilename()
           
 java.lang.String getLongDescription()
          Returns a long description of the package's functionality that may contain html tags.
 java.lang.String getName()
           
 java.lang.String getPackage()
           
 java.lang.String getPackageStatus()
           
 java.util.Properties getProperties()
           
 java.lang.String getProperty(java.lang.String key)
          Returns a property.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Returns a property.
 java.lang.String[] getPropertyList(java.lang.String key)
          Returns a property that is a list of strings.
 java.lang.String getProvides()
           
 long getReleaseNr()
           
 java.lang.String getSection()
           
 long getSize()
           
 java.lang.String getStatus()
           
 java.lang.String getStatus(int pos)
           
 java.lang.String getVersion()
           
 boolean isAvailable()
           
 boolean isBase()
           
 boolean isCore()
           
 boolean isInstalled()
           
 boolean isNew()
           
 boolean isPatch()
           
 boolean isPlugin()
           
 boolean isUpdateAvailable()
           
 boolean isValid()
           
 void putAll(java.util.Properties p)
           
 void setAction(java.lang.String action)
          Action can be "deinstall", "hold", "install", "purge"
 void setAvailable(boolean available)
           
 void setClassPath(java.lang.String[] classPath)
           
 void setControlPath(java.lang.String controlPath)
           
 void setDescription(java.lang.String description)
           
 void setDownloadFilename(java.lang.String filename)
           
 void setInstalled(boolean installed)
           
 void setNew(boolean isNew)
           
 void setPackage(java.lang.String packageName)
           
 void setSection(java.lang.String section)
           
 void setStatus(java.lang.String status)
           
 void setStatus(java.lang.String action, java.lang.String actionStatus, java.lang.String packageStatus)
           
 void setVersion(java.lang.String version)
           
 java.lang.String toString()
          Returns the value of getName().
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DELIMETER

public static final java.lang.String DELIMETER
See Also:
Constant Field Values

ACTION_INSTALL

public static final java.lang.String ACTION_INSTALL
See Also:
Constant Field Values

PACKAGE_STATUS_INSTALLED

public static final java.lang.String PACKAGE_STATUS_INSTALLED
See Also:
Constant Field Values

STATUS_INSTALLED

public static final java.lang.String STATUS_INSTALLED
See Also:
Constant Field Values

STATUS_NOT_INSTALLED

public static final java.lang.String STATUS_NOT_INSTALLED
See Also:
Constant Field Values
Constructor Detail

PackageInfo

public PackageInfo(java.util.Properties props)
Constructs a new plugin information record from p. All keys with prefix are copied to this info object.

Parameters:
prefix - the key prefix
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Lower versions come first.

Specified by:
compareTo in interface java.lang.Comparable

compareToVersion

public int compareToVersion(PackageInfo info)
Returns a value > 0 if the version of this package is higher than the version of info.


compareToVersion

public int compareToVersion(java.lang.String version)

containsProperties

public boolean containsProperties(java.util.Properties p)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getAction

public java.lang.String getAction()
See setAction(String) for possible return values.


getActionStatus

public java.lang.String getActionStatus()
Returns "ok".


getAuthors

public java.lang.String getAuthors()

getClassPath

public java.lang.String[] getClassPath()
Returns an empty array if no dependencies are defined.

Returns:
never returns null

getControlPath

public java.lang.String getControlPath()

getDepends

public java.lang.String getDepends()

getDescription

public java.lang.String getDescription()

getDownloadFilename

public java.lang.String getDownloadFilename()

getDownloadURLs

public java.lang.String[] getDownloadURLs()

getFile

public java.io.File getFile(java.lang.String filename)
Returns a file that is relative to this packages location.


getFilename

public java.lang.String getFilename()

getLongDescription

public java.lang.String getLongDescription()
Returns a long description of the package's functionality that may contain html tags.


getName

public java.lang.String getName()

getPackage

public java.lang.String getPackage()

getPackageStatus

public java.lang.String getPackageStatus()

getProperties

public java.util.Properties getProperties()

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Returns a property.


getProperty

public java.lang.String getProperty(java.lang.String key)
Returns a property.


getPropertyList

public java.lang.String[] getPropertyList(java.lang.String key)
Returns a property that is a list of strings.


getProvides

public java.lang.String getProvides()

getReleaseNr

public long getReleaseNr()

getSection

public java.lang.String getSection()

getSize

public long getSize()

getStatus

public java.lang.String getStatus()

getStatus

public java.lang.String getStatus(int pos)

getVersion

public java.lang.String getVersion()

isAvailable

public boolean isAvailable()

isBase

public boolean isBase()

isCore

public boolean isCore()

isPatch

public boolean isPatch()

isInstalled

public boolean isInstalled()

isNew

public boolean isNew()

isPlugin

public boolean isPlugin()

isUpdateAvailable

public boolean isUpdateAvailable()

isValid

public boolean isValid()

putAll

public void putAll(java.util.Properties p)

setAction

public void setAction(java.lang.String action)
Action can be "deinstall", "hold", "install", "purge"


setAvailable

public void setAvailable(boolean available)

setClassPath

public void setClassPath(java.lang.String[] classPath)

setControlPath

public void setControlPath(java.lang.String controlPath)

setDescription

public void setDescription(java.lang.String description)

setDownloadFilename

public void setDownloadFilename(java.lang.String filename)

setInstalled

public void setInstalled(boolean installed)

setNew

public void setNew(boolean isNew)

setPackage

public void setPackage(java.lang.String packageName)

setSection

public void setSection(java.lang.String section)

setStatus

public void setStatus(java.lang.String status)

setStatus

public void setStatus(java.lang.String action,
                      java.lang.String actionStatus,
                      java.lang.String packageStatus)

setVersion

public void setVersion(java.lang.String version)

toString

public java.lang.String toString()
Returns the value of getName().

Overrides:
toString in class java.lang.Object


Copyright © 2001-2005 XNap Team. All Rights Reserved.