org.codehaus.plexus.archiver

Class ArchiveEntry

public class ArchiveEntry extends Object

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

Field Summary
static intDIRECTORY
Filefile
static intFILE
intmode
Stringname
static StringROLE
inttype
Constructor Summary
ArchiveEntry(String name, File original, int type, int mode)
Method Summary
static ArchiveEntrycreateDirectoryEntry(String target, File file, int permissions)
static ArchiveEntrycreateEntry(String target, File file, int filePerm, int dirPerm)
Creates the correct ArchiveEntry instance for either a FILE or a DIRECTORY.
static ArchiveEntrycreateFileEntry(String target, File file, int permissions)
FilegetFile()
intgetMode()
StringgetName()
intgetType()
TODO: support for SYMLINK?

Field Detail

DIRECTORY

public static final int DIRECTORY

file

private File file

FILE

public static final int FILE

mode

private int mode

name

private String name

ROLE

public static final String ROLE

type

private int type

Constructor Detail

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 Detail

createDirectoryEntry

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

createEntry

public static ArchiveEntry createEntry(String target, File file, int filePerm, int dirPerm)
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.

createFileEntry

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

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