com.threerings.jpkg.debian
Class PackageVersion

java.lang.Object
  extended by com.threerings.jpkg.debian.PackageVersion
All Implemented Interfaces:
ControlFileData

public class PackageVersion
extends Object
implements ControlFileData

Holds and parses the Debian package version.

See Also:
Debian Policy Manual

Constructor Summary
PackageVersion(String upstream_version)
          Construct a fully populated PackageVersion object with the "upstream_version" field set to the supplied value.
PackageVersion(String upstream_version, String debian_version, int epoch)
          Construct a fully populated PackageVersion object with the "upstream_version", "debian_version", and "epoch" set.
 
Method Summary
 String getField()
          Returns the field of the Debian control file this data belongs in.
 String getFieldValue()
          Returns the data in this class formatted for the Debian control file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackageVersion

public PackageVersion(String upstream_version)
               throws ControlDataInvalidException
Construct a fully populated PackageVersion object with the "upstream_version" field set to the supplied value. The supplied string may only contain alphanumeric characters, ".", "+", and "~". The Debian version and epoch fields of the version field will not be set, meaning they will have the default values assigned to them by the dpkg tools. If the supplied string does not match these rules a ControlDataInvalidException will be thrown.

Throws:
ControlDataInvalidException

PackageVersion

public PackageVersion(String upstream_version,
                      String debian_version,
                      int epoch)
               throws ControlDataInvalidException
Construct a fully populated PackageVersion object with the "upstream_version", "debian_version", and "epoch" set. The upstream version may only contain alphanumeric characters, ".", "+", "-", ":", and "~". The Debian version may only contain alphanumeric characters, "+", ".", and "~". It is conventional to start the Debian version at 1. Epoch must be 0 or greater. 0 is a safe default and indicates no epoch. If the supplied string does not match these rules a ControlDataInvalidException will be thrown.

Throws:
ControlDataInvalidException
Method Detail

getField

public String getField()
Description copied from interface: ControlFileData
Returns the field of the Debian control file this data belongs in.

Specified by:
getField in interface ControlFileData

getFieldValue

public String getFieldValue()
Description copied from interface: ControlFileData
Returns the data in this class formatted for the Debian control file.

Specified by:
getFieldValue in interface ControlFileData


Copyright © 2007-2008 Three Rings Design, Inc. All Rights Reserved. Released under a BSD license.