CentralDirectoryInfo

public final class CentralDirectoryInfo
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.zip.CentralDirectoryInfo


CentralDirectoryInfo là một lớp chứa thông tin của một tệp/thư mục bên trong tệp zip.

Định dạng tệp zip tổng thể: [Tiêu đề tệp cục bộ + Dữ liệu nén [+ Tiêu đề cục bộ mở rộng]?]* [Thư mục trung tâm]* [Bản ghi cuối thư mục trung tâm]

Tham khảo đường liên kết sau để biết thêm thông tin chi tiết: https://en.wikipedia.org/wiki/Zip_(file_format)

Tóm tắt

Hàm khởi tạo công khai

CentralDirectoryInfo(byte[] data, int startOffset)

Hàm khởi tạo để thu thập thông tin của một mục tệp trong tệp ZIP.

CentralDirectoryInfo(byte[] data, int startOffset, boolean useZip64)

Hàm khởi tạo để thu thập thông tin của một mục tệp trong tệp ZIP.

Hàm khởi tạo được bảo vệ

CentralDirectoryInfo()

Hàm khởi tạo mặc định dùng cho kiểm thử đơn vị.

Phương thức công khai

boolean equals(Object o)
int getCompressedSize()

Lấy kích thước nén.

int getCompressionMethod()

Lấy phương thức nén.

long getCrc()

Lấy CRC của tệp.

long getExternalFileAttributes()

Lấy các thuộc tính của tệp bên ngoài.

int getExtraFieldLength()

Lấy độ dài của trường bổ sung.

int getFileCommentLength()

Lấy độ dài của bình luận trong tệp.

String getFileName()

Lấy tên tệp, bao gồm cả đường dẫn tương đối.

int getFileNameLength()

Lấy độ dài tên tệp.

int getFilePermission()

Lấy quyền đối với tệp Linux, được lưu trữ trong 9 bit cuối cùng của thuộc tính tệp bên ngoài.

int getInfoSize()

Lấy kích thước của mục nhập thư mục trung tâm.

int getInternalFileAttributes()

Lấy các thuộc tính của tệp nội bộ.

long getLocalHeaderOffset()

Lấy độ lệch của mục tiêu đề tệp cục bộ.

long getUncompressedSize()

Lấy kích thước chưa nén.

int hashCode()
boolean isSymLink()

Kiểm tra xem đây có phải là một đường liên kết tượng trưng hay không.

void setCompressedSize(long compressionSize)

Đặt kích thước nén.

void setCompressionMethod(int compressionMethod)

Đặt phương thức nén.

void setCrc(long crc)

Đặt CRC của tệp.

void setExternalFileAttributes(long externalFileAttributes)

Đặt các thuộc tính của tệp bên ngoài.

void setExtraFieldLength(int extraFieldLength)

Đặt độ dài của trường bổ sung.

void setFileCommentLength(int fileCommentLength)

Đặt độ dài của bình luận trong tệp.

void setFileName(String fileName)

Đặt tên tệp, bao gồm cả đường dẫn tương đối.

void setFileNameLength(int fileNameLength)

Đặt độ dài tên tệp.

void setInternalFileAttributes(int internalFileAttributes)

Đặt các thuộc tính của tệp nội bộ.

void setLocalHeaderOffset(long localHeaderOffset)

Đặt độ lệch của mục tiêu đề tệp cục bộ.

void setUncompressedSize(long uncompressedSize)

Đặt kích thước chưa nén.

String toString()

Hàm khởi tạo công khai

CentralDirectoryInfo

public CentralDirectoryInfo (byte[] data, 
                int startOffset)

Hàm khởi tạo để thu thập thông tin của một mục tệp trong tệp ZIP.

Tham số
data byte: byte[] dữ liệu chứa thông tin của một mục nhập tệp.

startOffset int: độ lệch bắt đầu của khối thông tin.

Gửi
java.io.IOException
IOException

CentralDirectoryInfo

public CentralDirectoryInfo (byte[] data, 
                int startOffset, 
                boolean useZip64)

Hàm khởi tạo để thu thập thông tin của một mục tệp trong tệp ZIP.

Tham số
data byte: byte[] dữ liệu chứa thông tin của một mục nhập tệp.

startOffset int: độ lệch bắt đầu của khối thông tin.

useZip64 boolean: một giá trị boolean để hỗ trợ định dạng zip64 trong quá trình tải xuống một phần.

Gửi
java.io.IOException
IOException

Hàm khởi tạo được bảo vệ

CentralDirectoryInfo

protected CentralDirectoryInfo ()

Hàm khởi tạo mặc định dùng cho kiểm thử đơn vị.

Phương thức công khai

bằng

public boolean equals (Object o)

Tham số
o Object

Giá trị trả về
boolean

getCompressedSize

public int getCompressedSize ()

Lấy kích thước nén.

Giá trị trả về
int

getCompressionMethod

public int getCompressionMethod ()

Lấy phương thức nén.

Giá trị trả về
int

getCrc

public long getCrc ()

Lấy CRC của tệp.

Giá trị trả về
long

getExternalFileAttributes

public long getExternalFileAttributes ()

Lấy các thuộc tính của tệp bên ngoài.

Giá trị trả về
long

getExtraFieldLength

public int getExtraFieldLength ()

Lấy độ dài của trường bổ sung.

Giá trị trả về
int

getFileCommentLength

public int getFileCommentLength ()

Lấy độ dài của bình luận trong tệp.

Giá trị trả về
int

getFileName

public String getFileName ()

Lấy tên tệp, bao gồm cả đường dẫn tương đối.

Giá trị trả về
String

getFileNameLength

public int getFileNameLength ()

Lấy độ dài tên tệp.

Giá trị trả về
int

getFilePermission

public int getFilePermission ()

Lấy quyền đối với tệp Linux, được lưu trữ trong 9 bit cuối cùng của thuộc tính tệp bên ngoài.

Giá trị trả về
int

getInfoSize

public int getInfoSize ()

Lấy kích thước của mục nhập thư mục trung tâm.

Giá trị trả về
int

getInternalFileAttributes

public int getInternalFileAttributes ()

Lấy các thuộc tính của tệp nội bộ.

Giá trị trả về
int

getLocalHeaderOffset

public long getLocalHeaderOffset ()

Lấy độ lệch của mục tiêu đề tệp cục bộ.

Giá trị trả về
long

getUncompressedSize

public long getUncompressedSize ()

Lấy kích thước chưa nén.

Giá trị trả về
long

hashCode

public int hashCode ()

Giá trị trả về
int

isSymLink

public boolean isSymLink ()

Kiểm tra xem đây có phải là một đường liên kết tượng trưng hay không.

Giá trị trả về
boolean

setCompressedSize

public void setCompressedSize (long compressionSize)

Đặt kích thước nén.

Tham số
compressionSize long

setCompressionMethod

public void setCompressionMethod (int compressionMethod)

Đặt phương thức nén.

Tham số
compressionMethod int

setCrc

public void setCrc (long crc)

Đặt CRC của tệp.

Tham số
crc long

setExternalFileAttributes

public void setExternalFileAttributes (long externalFileAttributes)

Đặt các thuộc tính của tệp bên ngoài.

Tham số
externalFileAttributes long

setExtraFieldLength

public void setExtraFieldLength (int extraFieldLength)

Đặt độ dài của trường bổ sung.

Tham số
extraFieldLength int

setFileCommentLength

public void setFileCommentLength (int fileCommentLength)

Đặt độ dài của bình luận trong tệp.

Tham số
fileCommentLength int

setFileName

public void setFileName (String fileName)

Đặt tên tệp, bao gồm cả đường dẫn tương đối.

Tham số
fileName String

setFileNameLength

public void setFileNameLength (int fileNameLength)

Đặt độ dài tên tệp.

Tham số
fileNameLength int

setInternalFileAttributes

public void setInternalFileAttributes (int internalFileAttributes)

Đặt các thuộc tính của tệp nội bộ.

Tham số
internalFileAttributes int

setLocalHeaderOffset

public void setLocalHeaderOffset (long localHeaderOffset)

Đặt độ lệch của mục tiêu đề tệp cục bộ.

Tham số
localHeaderOffset long

setUncompressedSize

public void setUncompressedSize (long uncompressedSize)

Đặt kích thước chưa nén.

Tham số
uncompressedSize long

toString

public String toString ()

Giá trị trả về
String