类 AsiExtraField
java.lang.Object
com.sh.common.zip.AsiExtraField
- 所有已实现的接口:
UnixStat,ZipExtraField,Cloneable
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
Short is two bytes and Long is four bytes in big endian byte and word order, device numbers are currently not supported.
-
字段概要
从接口继承的字段 com.sh.common.zip.UnixStat
DEFAULT_DIR_PERM, DEFAULT_FILE_PERM, DEFAULT_LINK_PERM, DIR_FLAG, FILE_FLAG, LINK_FLAG, PERM_MASK -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明clone()byte[]Delegate to local file data.Delegate to local file data.intGet the group id.The Header-ID.Name of linked filebyte[]The actual data to put into local file data - without Header-ID or length specifier.Length of the extra field in the local file data - without Header-ID or length specifier.intgetMode()File mode of this file.protected intgetMode(int mode) Get the file mode for given permissions with the correct file type.intGet the user id.booleanIs this entry a directory?booleanisLink()Is this entry a symbolic link?voidparseFromLocalFileData(byte[] data, int offset, int length) Populate data from this array as if it was in local file data.voidsetDirectory(boolean dirFlag) Indicate whether this entry is a directory.voidsetGroupId(int gid) Set the group id.voidsetLinkedFile(String name) Indicate that this entry is a symbolic link to the given filename.voidsetMode(int mode) File mode of this file.voidsetUserId(int uid) Set the user id.
-
构造器详细资料
-
AsiExtraField
public AsiExtraField()Constructor for AsiExtraField.
-
-
方法详细资料
-
getHeaderId
The Header-ID.- 指定者:
getHeaderId在接口中ZipExtraField- 返回:
- the value for the header id for this extrafield
- 从以下版本开始:
- 1.1
-
getLocalFileDataLength
Length of the extra field in the local file data - without Header-ID or length specifier.- 指定者:
getLocalFileDataLength在接口中ZipExtraField- 返回:
- a
ZipShortfor the length of the data of this extra field - 从以下版本开始:
- 1.1
-
getCentralDirectoryLength
Delegate to local file data.- 指定者:
getCentralDirectoryLength在接口中ZipExtraField- 返回:
- the centralDirectory length
- 从以下版本开始:
- 1.1
-
getLocalFileDataData
public byte[] getLocalFileDataData()The actual data to put into local file data - without Header-ID or length specifier.- 指定者:
getLocalFileDataData在接口中ZipExtraField- 返回:
- get the data
- 从以下版本开始:
- 1.1
-
getCentralDirectoryData
public byte[] getCentralDirectoryData()Delegate to local file data.- 指定者:
getCentralDirectoryData在接口中ZipExtraField- 返回:
- the local file data
- 从以下版本开始:
- 1.1
-
setUserId
public void setUserId(int uid) Set the user id.- 参数:
uid- the user id- 从以下版本开始:
- 1.1
-
getUserId
public int getUserId()Get the user id.- 返回:
- the user id
- 从以下版本开始:
- 1.1
-
setGroupId
public void setGroupId(int gid) Set the group id.- 参数:
gid- the group id- 从以下版本开始:
- 1.1
-
getGroupId
public int getGroupId()Get the group id.- 返回:
- the group id
- 从以下版本开始:
- 1.1
-
setLinkedFile
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
-
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
-
isLink
public boolean isLink()Is this entry a symbolic link?- 返回:
- true if this is a symbolic link
- 从以下版本开始:
- 1.1
-
setMode
public void setMode(int mode) File mode of this file.- 参数:
mode- the file mode- 从以下版本开始:
- 1.1
-
getMode
public int getMode()File mode of this file.- 返回:
- the file mode
- 从以下版本开始:
- 1.1
-
setDirectory
public void setDirectory(boolean dirFlag) Indicate whether this entry is a directory.- 参数:
dirFlag- if true, this entry is a directory- 从以下版本开始:
- 1.1
-
isDirectory
public boolean isDirectory()Is this entry a directory?- 返回:
- true if this entry is a directory
- 从以下版本开始:
- 1.1
-
parseFromLocalFileData
Populate data from this array as if it was in local file data.- 指定者:
parseFromLocalFileData在接口中ZipExtraField- 参数:
data- an array of bytesoffset- the start offsetlength- the number of bytes in the array from offset- 抛出:
ZipException- on error- 从以下版本开始:
- 1.1
-
getMode
protected int getMode(int mode) Get the file mode for given permissions with the correct file type.- 参数:
mode- the mode- 返回:
- the type with the mode
- 从以下版本开始:
- 1.1
-
clone
-