org.xnap.commons.pkg
Class PackageInfo

java.lang.Object
  extended by org.xnap.commons.pkg.PackageInfo
All Implemented Interfaces:
Comparable

public class PackageInfo
extends Object
implements Comparable

This class serves as a plugin information record.


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

ACTION_INSTALL

public static final String ACTION_INSTALL
See Also:
Constant Field Values

PACKAGE_STATUS_INSTALLED

public static final String PACKAGE_STATUS_INSTALLED
See Also:
Constant Field Values

STATUS_INSTALLED

public static final String STATUS_INSTALLED
See Also:
Constant Field Values

STATUS_NOT_INSTALLED

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

PackageInfo

public PackageInfo(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

PackageInfo

PackageInfo(String packageName)

PackageInfo

PackageInfo()
Method Detail

compareTo

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

Specified by:
compareTo in interface 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(String version)

containsProperties

public boolean containsProperties(Properties p)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

getAction

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


getActionStatus

public String getActionStatus()
Returns "ok".


getAuthors

public String getAuthors()

getClassPath

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

Returns:
never returns null

getControlPath

public String getControlPath()

getDepends

public String getDepends()

getDescription

public String getDescription()

getDownloadFilename

public String getDownloadFilename()

getDownloadURLs

public String[] getDownloadURLs()

getFile

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


getFilename

public String getFilename()

getLongDescription

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


getName

public String getName()

getPackage

public String getPackage()

getPackageStatus

public String getPackageStatus()

getProperties

public Properties getProperties()

getProperty

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


getProperty

public String getProperty(String key)
Returns a property.


getPropertyList

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


getProvides

public String getProvides()

getReleaseNr

public long getReleaseNr()

getSection

public String getSection()

getSize

public long getSize()

getStatus

public String getStatus()

getStatus

public String getStatus(int pos)

getVersion

public 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(Properties p)

setAction

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


setAvailable

public void setAvailable(boolean available)

setClassPath

public void setClassPath(String[] classPath)

setControlPath

public void setControlPath(String controlPath)

setDescription

public void setDescription(String description)

setDownloadFilename

public void setDownloadFilename(String filename)

setInstalled

public void setInstalled(boolean installed)

setNew

public void setNew(boolean isNew)

setPackage

public void setPackage(String packageName)

setSection

public void setSection(String section)

setStatus

public void setStatus(String status)

setStatus

public void setStatus(String action,
                      String actionStatus,
                      String packageStatus)

setVersion

public void setVersion(String version)

toString

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

Overrides:
toString in class Object


Copyright © 2004-2006 XNap Commons Team. All Rights Reserved.