net.sf.jpkgmk.pkgmap
Class PkgMap

java.lang.Object
  extended by net.sf.jpkgmk.AbstractFileCreatorAdapter
      extended by net.sf.jpkgmk.pkgmap.PkgMap
All Implemented Interfaces:
FileHandler.ContentWriter

public class PkgMap
extends AbstractFileCreatorAdapter

pkgmap is an ASCII file that provides a complete listing of the package contents. It is automatically generated by pkgmk(1) using the information in the prototype(4) file. Representation of a package map file (called "pkgmap" on the filesystem). The pkgmap file is a packing list, where each item in the package is defined and its size and checksum are stored. The size and checksum help in determining that the package has not been tampered with. The various items in the pkgmap are recognized by their ftype entry as shown here. See sun docs http://www.cs.biu.ac.il/cgi-bin/man?pkgmap+4 and http://www.sun.com/bigadmin/features/techtips/package_components.jsp http://www.softpanorama.org/Solaris/Packages/index.shtml.

Since:
1.0
Version:
$Revision: 2 $ $Date: 2008-08-20 21:14:19 +0200 (Mi, 20 Aug 2008) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Field Summary
static java.lang.String PKGMAP
          The name of the file on the filesystem
 
Constructor Summary
PkgMap()
           
 
Method Summary
 void add(PkgMapEntry entry)
          Adds a prototype entry.
 void addAll(java.util.List<PkgMapEntry> pkgMapEntryList)
          Adds all the given entries to this pkgmap object.
 boolean equals(java.lang.Object obj)
           
 boolean equals(java.lang.Object obj, boolean ignoreLastModified)
           
 FileHandler getFileHandler(java.io.File targetDir)
           
 PkgMapEntryHeader getHeader()
           
 java.lang.Integer getNumberOfParts()
           
 java.util.List<PkgMapEntry> getPkgMapEntries()
           
 int getSize()
           
 int hashCode()
           
 void setHeader(PkgMapEntryHeader header)
          Sets the only header for this pkgmap.
 java.lang.String toString()
           
 void writeContent(java.io.Writer writer)
           
 
Methods inherited from class net.sf.jpkgmk.AbstractFileCreatorAdapter
clean, create
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PKGMAP

public static final java.lang.String PKGMAP
The name of the file on the filesystem

See Also:
Constant Field Values
Constructor Detail

PkgMap

public PkgMap()
Method Detail

getFileHandler

public FileHandler getFileHandler(java.io.File targetDir)
Specified by:
getFileHandler in class AbstractFileCreatorAdapter

writeContent

public void writeContent(java.io.Writer writer)
                  throws java.io.IOException
Throws:
java.io.IOException

getPkgMapEntries

public java.util.List<PkgMapEntry> getPkgMapEntries()
Returns:
Unmodifiable list of the pkgmap entries

addAll

public void addAll(java.util.List<PkgMapEntry> pkgMapEntryList)
Adds all the given entries to this pkgmap object.

Parameters:
pkgMapEntryList -

add

public void add(PkgMapEntry entry)
Adds a prototype entry. Does not create the physical file yet

Parameters:
entry -

setHeader

public void setHeader(PkgMapEntryHeader header)
Sets the only header for this pkgmap. If it was already set before, an exception is thrown.

Parameters:
header -

getHeader

public PkgMapEntryHeader getHeader()

getSize

public int getSize()
Returns:
Returns the number of entries that are currently in this map

getNumberOfParts

public java.lang.Integer getNumberOfParts()
Returns:
The number of different parts that exist in the current pkgmap. If the part of an entry is null, the value 1 is assumed by default as defined in the sun specs.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

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

equals

public boolean equals(java.lang.Object obj,
                      boolean ignoreLastModified)
Parameters:
obj -
ignoreLastModified -
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2007-2008. All Rights Reserved.