gpt4 book ai didi

net.lingala.zip4j.exception.ZipException.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 00:28:49 27 4
gpt4 key购买 nike

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

ZipException.<init>介绍

暂无

代码示例

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

public Unzip(ZipModel zipModel) throws ZipException {
  
  if (zipModel == null) {
    throw new ZipException("ZipModel is null");
  }
  
  this.zipModel = zipModel;
}

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

public ZipEngine(ZipModel zipModel) throws ZipException {
  
  if (zipModel == null) {
    throw new ZipException("zip model is null in ZipEngine constructor");
  }
  
  this.zipModel = zipModel;
}

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

public UnzipEngine(ZipModel zipModel, FileHeader fileHeader) throws ZipException {
  if (zipModel == null || fileHeader == null) {
    throw new ZipException("Invalid parameters passed to StoreUnzip. One or more of the parameters were null");
  }
  
  this.zipModel = zipModel;
  this.fileHeader = fileHeader;
  this.crc = new CRC32();
}

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

public static int readLeInt(DataInput di, byte[] b) throws ZipException{
  try {
    di.readFully(b, 0, 4);
  } catch (IOException e) {
    throw new ZipException(e);
  }
  return ((b[0] & 0xff) | (b[1] & 0xff) << 8)
    | ((b[2] & 0xff) | (b[3] & 0xff) << 8) << 16;
}

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

private byte[] getAESPasswordVerifier(RandomAccessFile raf) throws ZipException {
  try {
    byte[] pvBytes = new byte[2];
    raf.read(pvBytes);
    return pvBytes;
  } catch (IOException e) {
    throw new ZipException(e);
  }
}

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

public static boolean checkFileExists(File file) throws ZipException {
  if (file == null) {
    throw new ZipException("cannot check if file exists: input file is null");
  }
  return file.exists();
}

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

public static boolean checkFileExists(File file) throws ZipException {
  if (file == null) {
    throw new ZipException("cannot check if file exists: input file is null");
  }
  return file.exists();
}

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

public static long getFileLengh(File file) throws ZipException {
  if (file == null) {
    throw new ZipException("input file is null, cannot calculate file length");
  }
  
  if (file.isDirectory()) {
    return -1;
  }
  
  return file.length();
}

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

private void copyByteArrayToArrayList(byte[] byteArray, List arrayList) throws ZipException {
  if (arrayList == null || byteArray == null) {
    throw new ZipException("one of the input parameters is null, cannot copy byte array to array list");
  }
  
  for (int i = 0; i < byteArray.length; i++) {
    arrayList.add(Byte.toString(byteArray[i]));
  }
}

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

private void init(NativeFile raf) throws ZipException {
  
  if (localFileHeader == null) {
    throw new ZipException("local file header is null, cannot initialize input stream");
  }
  
  try {
    initDecrypter(raf);
  } catch (ZipException e) {
    throw e;
  } catch (Exception e) {
    throw new ZipException(e);
  }
}

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

public int encryptData(byte[] buff) throws ZipException {
  
  if (buff == null) {
    throw new ZipException("input bytes are null, cannot perform AES encrpytion");
  }
  return encryptData(buff, 0, buff.length);
}

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

/**
 * Returns an absoulte path for the given file path 
 * @param filePath
 * @return String
 */
public static String getAbsoluteFilePath(String filePath) throws ZipException {
  if (!isStringNotNullAndNotEmpty(filePath)) {
    throw new ZipException("filePath is null or empty, cannot get absolute file path");
  }
  
  File file = new File(filePath);
  return file.getAbsolutePath();
}

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

public static void setFileReadOnly(File file) throws ZipException {
  if (file == null) {
    throw new ZipException("input file is null. cannot set read only file attribute");
  }
  
  if (file.exists()) {
    file.setReadOnly();
  }
}

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

private RandomAccessFile createFileHandler(ZipModel zipModel, String mode) throws ZipException {
  if (zipModel == null || !Zip4jUtil.isStringNotNullAndNotEmpty(zipModel.getZipFile())) {
    throw new ZipException("input parameter is null in getFilePointer, cannot create file handler to remove file");
  }
  
  try {
    return new RandomAccessFile(new File(zipModel.getZipFile()), mode);
  } catch (FileNotFoundException e) {
    throw new ZipException(e);
  }
}

代码示例来源: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

public static boolean checkFileExists(String path) throws ZipException {
  if (!isStringNotNullAndNotEmpty(path)) {
    throw new ZipException("path is null");
  }
  
  File file = new File(path);
  return checkFileExists(file);
}

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

private NativeFile createFileHandler(ZipModel zipModel) throws ZipException {
  if (zipModel == null || !Zip4jUtil.isStringNotNullAndNotEmpty(zipModel.getZipFile())) {
    throw new ZipException("input parameter is null in getFilePointer, cannot create file handler to remove file");
  }
  
  try {
    return zipModel.getZipFile().read();
  } catch (FileNotFoundException e) {
    throw new ZipException(e);
  }
}

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

public static boolean checkFileExists(NativeStorage path) throws ZipException {
  if (!isStringNotNullAndNotEmpty(path)) {
    throw new ZipException("path is null");
  }
  
  return path.exists();
}

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

private byte[] deriveKey(byte[] salt, char[] password) throws ZipException {
  try {
    PBKDF2Parameters p = new PBKDF2Parameters("HmacSHA1", "ISO-8859-1",
          salt, 1000);
    PBKDF2Engine e = new PBKDF2Engine(p);
    byte[] derivedKey = e.deriveKey(password, KEY_LENGTH + MAC_LENGTH + PASSWORD_VERIFIER_LENGTH);
    return derivedKey;
  } catch (Exception e) {
    throw new ZipException(e);
  }
}

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

public void initProgressMonitorForMergeOp(ZipModel zipModel, ProgressMonitor progressMonitor) throws ZipException {
  if (zipModel == null) {
    throw new ZipException("zip model is null, cannot calculate total work for merge op");
  }
  
  progressMonitor.setCurrentOperation(ProgressMonitor.OPERATION_MERGE);
  progressMonitor.setFileName(zipModel.getZipFile());
  progressMonitor.setTotalWork(calculateTotalWorkForMergeOp(zipModel));
  progressMonitor.setState(ProgressMonitor.STATE_BUSY);
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com