net.lingala.zip4j.util.Zip4jUtil.getFileHeader()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(171)

本文整理了Java中net.lingala.zip4j.util.Zip4jUtil.getFileHeader()方法的一些代码示例,展示了Zip4jUtil.getFileHeader()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zip4jUtil.getFileHeader()方法的具体详情如下:
包路径:net.lingala.zip4j.util.Zip4jUtil
类名称:Zip4jUtil
方法名:getFileHeader

Zip4jUtil.getFileHeader介绍

暂无

代码示例

代码示例来源:origin: net.lingala.zip4j/zip4j

/**
 * Returns FileHeader if a file header with the given fileHeader 
 * string exists in the zip model: If not returns null
 * @param fileName
 * @return FileHeader
 * @throws ZipException
 */
public FileHeader getFileHeader(String fileName) throws ZipException {
  if (!Zip4jUtil.isStringNotNullAndNotEmpty(fileName)) {
    throw new ZipException("input file name is emtpy or null, cannot get FileHeader");
  }
  
  readZipInfo();
  if (zipModel == null || zipModel.getCentralDirectory() == null) {
    return null;
  }
  
  return Zip4jUtil.getFileHeader(zipModel, fileName);
}

代码示例来源:origin: com.github.axet/zip4j

/**
 * Returns FileHeader if a file header with the given fileHeader 
 * string exists in the zip model: If not returns null
 * @param fileName
 * @return FileHeader
 * @throws ZipException
 */
public FileHeader getFileHeader(String fileName) throws ZipException {
  if (!Zip4jUtil.isStringNotNullAndNotEmpty(fileName)) {
    throw new ZipException("input file name is emtpy or null, cannot get FileHeader");
  }
  
  readZipInfo();
  if (zipModel == null || zipModel.getCentralDirectory() == null) {
    return null;
  }
  
  return Zip4jUtil.getFileHeader(zipModel, fileName);
}

代码示例来源:origin: net.lingala.zip4j/zip4j

String relativeFileName = Zip4jUtil.getRelativeFileName(
    ((File)fileList.get(i)).getAbsolutePath(), parameters.getRootFolderInZip(), parameters.getDefaultFolderPath());
FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, relativeFileName);
if (fileHeader != null) {
  totalWork += (Zip4jUtil.getFileLengh(new File(zipModel.getZipFile())) - fileHeader.getCompressedSize());

代码示例来源:origin: com.github.axet/zip4j

String relativeFileName = Zip4jUtil.getRelativeFileName(
    (NativeStorage)fileList.get(i), parameters.getRootFolderInZip(), parameters.getDefaultFolderPath());
FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, relativeFileName);
if (fileHeader != null) {
  totalWork += (Zip4jUtil.getFileLengh(zipModel.getZipFile()) - fileHeader.getCompressedSize());

代码示例来源:origin: net.lingala.zip4j/zip4j

parameters.getRootFolderInZip(), parameters.getDefaultFolderPath());
FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, fileName);
if (fileHeader != null) {

代码示例来源:origin: com.github.axet/zip4j

FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, fileName);
if (fileHeader == null) {
  throw new ZipException("could not find file header for file: " + fileName);

代码示例来源:origin: net.lingala.zip4j/zip4j

FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, fileName);
if (fileHeader == null) {
  throw new ZipException("could not find file header for file: " + fileName);

代码示例来源:origin: com.github.axet/zip4j

parameters.getRootFolderInZip(), parameters.getDefaultFolderPath());
FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, fileName);
if (fileHeader != null) {

代码示例来源:origin: net.lingala.zip4j/zip4j

FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, fileName);

代码示例来源:origin: com.github.axet/zip4j

FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, fileName);

相关文章