com.threerings.jpkg.debian
Class ControlFile

java.lang.Object
  extended by com.threerings.jpkg.debian.ControlFile
All Implemented Interfaces:
ArchiveEntry

public class ControlFile
extends Object
implements ArchiveEntry

Handles the creation of the Debian package control.tar.gz file.


Constructor Summary
ControlFile(PackageInfo info, PackageTarFile dataTar)
          Construct a new ControlFile which creates the contents of control.tar.gz entry in the Debian package.
 
Method Summary
 int getGroupId()
          Returns the group id which will own this entry in the archive.
 InputStream getInputStream()
          Returns an InputStream from the data contained in this entry.
 int getMode()
          Returns the file permissions mode (e.g.
 String getPath()
          Returns the path name used to identify this entry in the archive.
 long getSize()
          Returns the size of the data contained in this entry in bytes.
 int getUserId()
          Returns the user id which will own this entry in the archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlFile

public ControlFile(PackageInfo info,
                   PackageTarFile dataTar)
            throws IOException,
                   ScriptDataTooLargeException
Construct a new ControlFile which creates the contents of control.tar.gz entry in the Debian package.

Parameters:
info - The fully populated package meta data.
dataTar - The fully populated PackageTarFile represented by this control file.
Throws:
IOException - If any i/o exceptions occur during the control file creation.
ScriptDataTooLargeException - If any maintainer script is too large to be added to the tar file.
Method Detail

getInputStream

public InputStream getInputStream()
Description copied from interface: ArchiveEntry
Returns an InputStream from the data contained in this entry.

Specified by:
getInputStream in interface ArchiveEntry

getSize

public long getSize()
Description copied from interface: ArchiveEntry
Returns the size of the data contained in this entry in bytes. An Archive can only store data whose size can be expressed in a 32 bit integer however the interface allows size to be expressed as a long to support for example File objects. The Archive class will guarantee that the size returned by this method can be converted safely into a 32 bit integer.

Specified by:
getSize in interface ArchiveEntry

getPath

public String getPath()
Description copied from interface: ArchiveEntry
Returns the path name used to identify this entry in the archive. Must be 15 characters or less.

Specified by:
getPath in interface ArchiveEntry

getUserId

public int getUserId()
Description copied from interface: ArchiveEntry
Returns the user id which will own this entry in the archive.

Specified by:
getUserId in interface ArchiveEntry

getGroupId

public int getGroupId()
Description copied from interface: ArchiveEntry
Returns the group id which will own this entry in the archive.

Specified by:
getGroupId in interface ArchiveEntry

getMode

public int getMode()
Description copied from interface: ArchiveEntry
Returns the file permissions mode (e.g. 0644) for this entry in the archive.

Specified by:
getMode in interface ArchiveEntry


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