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

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

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

Zip4jUtil.getFileLengh介绍

暂无

代码示例

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

public static long getFileLengh(String file) throws ZipException {
  if (!isStringNotNullAndNotEmpty(file)) {
    throw new ZipException("invalid file name");
  }
  
  return getFileLengh(new File(file));
}

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

private long calculateTotalWorkForRemoveOp(ZipModel zipModel, FileHeader fileHeader) throws ZipException {
  return Zip4jUtil.getFileLengh(new File(zipModel.getZipFile())) - fileHeader.getCompressedSize();
}

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

private long calculateTotalWorkForRemoveOp(ZipModel zipModel, FileHeader fileHeader) throws ZipException {
  return Zip4jUtil.getFileLengh(zipModel.getZipFile()) - fileHeader.getCompressedSize();
}

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

if (parameters.isEncryptFiles() && 
    parameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) {
  totalWork += (Zip4jUtil.getFileLengh((File)fileList.get(i)) * 2);
} else {
  totalWork += Zip4jUtil.getFileLengh((File)fileList.get(i));
  FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, relativeFileName);
  if (fileHeader != null) {
    totalWork += (Zip4jUtil.getFileLengh(new File(zipModel.getZipFile())) - fileHeader.getCompressedSize());

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

private long calculateTotalWorkForMergeOp(ZipModel zipModel) throws ZipException {
    long totSize = 0;
    if (zipModel.isSplitArchive()) {
      int totNoOfSplitFiles = zipModel.getEndCentralDirRecord().getNoOfThisDisk();
      String partFile = null;
      String curZipFile = zipModel.getZipFile();
      int partNumber = 0;
      for (int i = 0; i <= totNoOfSplitFiles; i++) {
        if (partNumber == zipModel.getEndCentralDirRecord().getNoOfThisDisk()) {
          partFile = zipModel.getZipFile();
        } else {
          if (partNumber >= 9) {
            partFile = curZipFile.substring(0, curZipFile.lastIndexOf(".")) + ".z" + (partNumber+ 1);
          } else{
            partFile = curZipFile.substring(0, curZipFile.lastIndexOf(".")) + ".z0" + (partNumber+ 1);
          }
        }
        
        totSize += Zip4jUtil.getFileLengh(new File(partFile)); 
      }
      
    }
    return totSize;
  }
}

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

if (parameters.isEncryptFiles() && 
    parameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) {
  totalWork += (Zip4jUtil.getFileLengh((File)fileList.get(i)) * 2);
} else {
  totalWork += Zip4jUtil.getFileLengh((File)fileList.get(i));
  FileHeader fileHeader = Zip4jUtil.getFileHeader(zipModel, relativeFileName);
  if (fileHeader != null) {
    totalWork += (Zip4jUtil.getFileLengh(zipModel.getZipFile()) - fileHeader.getCompressedSize());

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

private long calculateTotalWorkForMergeOp(ZipModel zipModel) throws ZipException {
    long totSize = 0;
    if (zipModel.isSplitArchive()) {
      int totNoOfSplitFiles = zipModel.getEndCentralDirRecord().getNoOfThisDisk();
      NativeStorage partFile = null;
      NativeStorage curZipFile = zipModel.getZipFile();
      String curZipFileName = curZipFile.getName();
      int partNumber = 0;
      for (int i = 0; i <= totNoOfSplitFiles; i++) {
        if (partNumber == zipModel.getEndCentralDirRecord().getNoOfThisDisk()) {
          partFile = zipModel.getZipFile();
        } else {
          if (partNumber >= 9) {
            partFile = curZipFile.getParent().open(curZipFileName.substring(0, curZipFileName.lastIndexOf(".")) + ".z" + (partNumber+ 1));
          } else{
            partFile = curZipFile.getParent().open(curZipFileName.substring(0, curZipFileName.lastIndexOf(".")) + ".z0" + (partNumber+ 1));
          }
        }
        
        totSize += Zip4jUtil.getFileLengh(partFile); 
      }
      
    }
    return totSize;
  }
}

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

if (Zip4jUtil.getFileLengh((File)fileList.get(i)) == 0) {
  fileParameters.setCompressionMethod(Zip4jConstants.COMP_STORE);

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

if (Zip4jUtil.getFileLengh((File)fileList.get(i)) == 0) {
  fileParameters.setCompressionMethod(Zip4jConstants.COMP_STORE);

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

} else {
  if (!zipParameters.isSourceExternalStream()) {
    long fileSize = Zip4jUtil.getFileLengh(sourceFile);
    if (zipParameters.getCompressionMethod() == Zip4jConstants.COMP_STORE) {
      if (zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) {

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

} else {
  if (!zipParameters.isSourceExternalStream()) {
    long fileSize = Zip4jUtil.getFileLengh(sourceFile);
    if (zipParameters.getCompressionMethod() == Zip4jConstants.COMP_STORE) {
      if (zipParameters.getEncryptionMethod() == Zip4jConstants.ENC_METHOD_STANDARD) {

相关文章