org.codehaus.plexus.archiver

Class ArchiveEntry


public class ArchiveEntry
extends java.lang.Object

Version:
$Revision: 1502 $ $Date: 2005-09-01 13:20:41 -0400 (Thu, 01 Sep 2005) $

Field Summary

static int
DIRECTORY
static int
FILE
static String
ROLE
private File
file
private int
mode
private String
name
private int
type

Constructor Summary

ArchiveEntry(String name, File original, int type, int mode)

Method Summary

static ArchiveEntry
createDirectoryEntry(String target, File file, int permissions)
static ArchiveEntry
createEntry(String target, File file, int filePerm, int dirPerm)
Creates the correct ArchiveEntry instance for either a FILE or a DIRECTORY.
static ArchiveEntry
createFileEntry(String target, File file, int permissions)
File
getFile()
int
getMode()
String
getName()
int
getType()
TODO: support for SYMLINK?

Field Details

DIRECTORY

public static final int DIRECTORY
Field Value:
2

FILE

public static final int FILE
Field Value:
1

ROLE

public static final String ROLE

file

private File file

mode

private int mode

name

private String name

type

private int type

Constructor Details

ArchiveEntry

private ArchiveEntry(String name,
                     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 Details

createDirectoryEntry

public static ArchiveEntry createDirectoryEntry(String target,
                                                File file,
                                                int permissions)
            throws ArchiverException

createEntry

public static ArchiveEntry createEntry(String target,
                                       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:
Throws:
ArchiverException - when file is neither a directory nor a file.

createFileEntry

public static ArchiveEntry createFileEntry(String target,
                                           File file,
                                           int permissions)
            throws ArchiverException

getFile

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

getMode

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

getName

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

getType

public int getType()
TODO: support for SYMLINK?
Returns:
FILE or DIRECTORY