org.apache.tools.zip
Class AsiExtraField
java.lang.Object
org.apache.tools.zip.AsiExtraField
- Cloneable, UnixStat, ZipExtraField
public class AsiExtraField
extends java.lang.Object
Adds Unix file permission and UID/GID fields as well as symbolic
link handling.
This class uses the ASi extra field in the format:
Value Size Description
----- ---- -----------
(Unix3) 0x756e Short tag for this extra block type
TSize Short total data size for this block
CRC Long CRC-32 of the remaining data
Mode Short file permissions
SizDev Long symlink'd size OR major/minor dev num
UID Short user ID
GID Short group ID
(var.) variable symbolic link filename
taken from appnote.iz (Info-ZIP note, 981119) found at
ftp://ftp.uu.net/pub/archiving/zip/doc/
Short is two bytes and Long is four bytes in big endian byte and
word order, device numbers are currently not supported.
Version:
AsiExtraField
public AsiExtraField()
getGroupId
public int getGroupId()
Get the group id.
- 1.1
getLinkedFile
public String getLinkedFile()
Name of linked file
- name of the file this entry links to if it is a
symbolic link, the empty string otherwise.
- 1.1
getLocalFileDataData
public byte[] getLocalFileDataData()
The actual data to put into local file data - without Header-ID
or length specifier.
- getLocalFileDataData in interface ZipExtraField
- 1.1
getMode
public int getMode()
File mode of this file.
- 1.1
getMode
protected int getMode(int mode)
Get the file mode for given permissions with the correct file type.
- 1.1
getUserId
public int getUserId()
Get the user id.
- 1.1
isDirectory
public boolean isDirectory()
Is this entry a directory?
- 1.1
isLink
public boolean isLink()
Is this entry a symbolic link?
- 1.1
parseFromLocalFileData
public void parseFromLocalFileData(byte[] data,
int offset,
int length)
throws ZipException
Populate data from this array as if it was in local file data.
- parseFromLocalFileData in interface ZipExtraField
- 1.1
setDirectory
public void setDirectory(boolean dirFlag)
Indicate whether this entry is a directory.
- 1.1
setGroupId
public void setGroupId(int gid)
Set the group id.
- 1.1
setLinkedFile
public void setLinkedFile(String name)
Indicate that this entry is a symbolic link to the given filename.
name
- Name of the file this entry links to, empty String
if it is not a symbolic link.
- 1.1
setMode
public void setMode(int mode)
File mode of this file.
- 1.1
setUserId
public void setUserId(int uid)
Set the user id.
- 1.1
Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.