org.codehaus.plexus.archiver
Class ArchiveEntry

java.lang.Object
  extended by org.codehaus.plexus.archiver.ArchiveEntry

public class ArchiveEntry
extends java.lang.Object

Version:
$Revision: 1502 $ $Date: 2006-08-21 17:05:02 -0400 (Mon, 21 Aug 2006) $

Field Summary
static int DIRECTORY
           
private  java.io.File file
           
static int FILE
           
private  int mode
           
private  java.lang.String name
           
static java.lang.String ROLE
           
private  int type
           
 
Constructor Summary
private ArchiveEntry(java.lang.String name, java.io.File original, int type, int mode)
           
 
Method Summary
static ArchiveEntry createDirectoryEntry(java.lang.String target, java.io.File file, int permissions)
           
static ArchiveEntry createEntry(java.lang.String target, java.io.File file, int filePerm, int dirPerm)
          Creates the correct ArchiveEntry instance for either a FILE or a DIRECTORY.
static ArchiveEntry createFileEntry(java.lang.String target, java.io.File file, int permissions)
           
 java.io.File getFile()
           
 int getMode()
           
 java.lang.String getName()
           
 int getType()
          TODO: support for SYMLINK?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROLE

public static final java.lang.String ROLE

FILE

public static final int FILE
See Also:
Constant Field Values

DIRECTORY

public static final int DIRECTORY
See Also:
Constant Field Values

name

private java.lang.String name

file

private java.io.File file

type

private int type

mode

private int mode
Constructor Detail

ArchiveEntry

private ArchiveEntry(java.lang.String name,
                     java.io.File original,
                     int type,
                     int mode)
Parameters:
name - the filename as it will appear in the archive
original - original filename
type - FILE or DIRECTORY
mode - octal unix style permissions
Method Detail

getName

public java.lang.String getName()
Returns:
the filename of this entry in the archive.

getFile

public java.io.File getFile()
Returns:
The original file that will be stored in the archive.

getType

public int getType()
TODO: support for SYMLINK?

Returns:
FILE or DIRECTORY

getMode

public int getMode()
Returns:
octal user/group/other unix like permissions.

createFileEntry

public static ArchiveEntry createFileEntry(java.lang.String target,
                                           java.io.File file,
                                           int permissions)
                                    throws ArchiverException
Throws:
ArchiverException

createDirectoryEntry

public static ArchiveEntry createDirectoryEntry(java.lang.String target,
                                                java.io.File file,
                                                int permissions)
                                         throws ArchiverException
Throws:
ArchiverException

createEntry

public static ArchiveEntry createEntry(java.lang.String target,
                                       java.io.File file,
                                       int filePerm,
                                       int dirPerm)
                                throws ArchiverException
Creates the correct ArchiveEntry instance for either a FILE or a DIRECTORY.

Parameters:
target -
file -
filePerm -
dirPerm -
Returns:
The created entry
Throws:
ArchiverException - when file is neither a directory nor a file.