com.izforge.izpack
Class PackFile

java.lang.Object
  extended bycom.izforge.izpack.PackFile
All Implemented Interfaces:
java.io.Serializable

public class PackFile
extends java.lang.Object
implements java.io.Serializable

Encloses information about a packed file. This class abstracts the way file data is stored to package.

Author:
Johannes Lehtinen
See Also:
Serialized Form

Field Summary
private  java.util.Map additionals
          Additional attributes or any else for customisation
private  boolean isDirectory
          True if file is a directory (length should be 0 or ignored)
private  long length
          The length of the file in bytes
private  long mtime
          The last-modification time of the file.
 long offsetInPreviousPack
           
private  java.util.List osConstraints
          The target operating system constraints of this file
private  int override
          Whether or not this file is going to override any existing ones
static int OVERRIDE_ASK_FALSE
           
static int OVERRIDE_ASK_TRUE
           
static int OVERRIDE_FALSE
           
static int OVERRIDE_TRUE
           
static int OVERRIDE_UPDATE
           
 int previousPackNumber
           
(package private) static long serialVersionUID
           
 java.lang.String sourcePath
           
private  java.lang.String targetPath
          The full path name of the target file
 
Constructor Summary
PackFile(java.io.File src, java.lang.String target, java.util.List osList, int override)
          Constructs and initializes from a source file.
PackFile(java.io.File src, java.lang.String target, java.util.List osList, int override, java.util.Map additionals)
          Constructs and initializes from a source file.
 
Method Summary
 java.util.Map getAdditionals()
          Returns the additionals map.
 java.lang.String getTargetPath()
          The full path name of the target file, using '/' as fileseparator.
 boolean isBackReference()
           
 boolean isDirectory()
           
 long lastModified()
          The last-modification time of the file.
 long length()
          The length of the file in bytes
 java.util.List osConstraints()
          The target operating system constraints of this file
 int override()
          Whether or not this file is going to override any existing ones
 void setPreviousPackFileRef(int previousPackNumber, long offsetInPreviousPack)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

OVERRIDE_FALSE

public static final int OVERRIDE_FALSE
See Also:
Constant Field Values

OVERRIDE_TRUE

public static final int OVERRIDE_TRUE
See Also:
Constant Field Values

OVERRIDE_ASK_FALSE

public static final int OVERRIDE_ASK_FALSE
See Also:
Constant Field Values

OVERRIDE_ASK_TRUE

public static final int OVERRIDE_ASK_TRUE
See Also:
Constant Field Values

OVERRIDE_UPDATE

public static final int OVERRIDE_UPDATE
See Also:
Constant Field Values

sourcePath

public java.lang.String sourcePath

targetPath

private java.lang.String targetPath
The full path name of the target file


osConstraints

private java.util.List osConstraints
The target operating system constraints of this file


length

private long length
The length of the file in bytes


mtime

private long mtime
The last-modification time of the file.


isDirectory

private boolean isDirectory
True if file is a directory (length should be 0 or ignored)


override

private int override
Whether or not this file is going to override any existing ones


additionals

private java.util.Map additionals
Additional attributes or any else for customisation


previousPackNumber

public int previousPackNumber

offsetInPreviousPack

public long offsetInPreviousPack
Constructor Detail

PackFile

public PackFile(java.io.File src,
                java.lang.String target,
                java.util.List osList,
                int override)
         throws java.io.FileNotFoundException
Constructs and initializes from a source file.

Parameters:
src - file which this PackFile describes
target - the path to install the file to
osList - OS constraints
override - what to do when the file already exists
Throws:
java.io.FileNotFoundException - if the specified file does not exist.

PackFile

public PackFile(java.io.File src,
                java.lang.String target,
                java.util.List osList,
                int override,
                java.util.Map additionals)
         throws java.io.FileNotFoundException
Constructs and initializes from a source file.

Parameters:
src - file which this PackFile describes
target - the path to install the file to
osList - OS constraints
override - what to do when the file already exists
additionals - additional attributes
Throws:
java.io.FileNotFoundException - if the specified file does not exist.
Method Detail

setPreviousPackFileRef

public void setPreviousPackFileRef(int previousPackNumber,
                                   long offsetInPreviousPack)

osConstraints

public final java.util.List osConstraints()
The target operating system constraints of this file


length

public final long length()
The length of the file in bytes


lastModified

public final long lastModified()
The last-modification time of the file.


override

public final int override()
Whether or not this file is going to override any existing ones


isDirectory

public final boolean isDirectory()

isBackReference

public final boolean isBackReference()

getTargetPath

public final java.lang.String getTargetPath()
The full path name of the target file, using '/' as fileseparator.


getAdditionals

public java.util.Map getAdditionals()
Returns the additionals map.

Returns:
additionals