gpt4 book ai didi

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

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

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

ZipException.getMessage介绍

暂无

代码示例

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

private void encryptAndWrite(byte[] b, int off, int len) throws IOException {
  if (encrypter != null) {
    try {
      encrypter.encryptData(b, off, len);
    } catch (ZipException e) {
      throw new IOException(e.getMessage());
    }
  }
  outputStream.write(b, off, len);
  totalBytesWritten += len;
  bytesWrittenForThisFile += len;
}

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

private void encryptAndWrite(byte[] b, int off, int len) throws IOException {
  if (encrypter != null) {
    try {
      encrypter.encryptData(b, off, len);
    } catch (ZipException e) {
      throw new IOException(e.getMessage());
    }
  }
  outputStream.write(b, off, len);
  totalBytesWritten += len;
  bytesWrittenForThisFile += len;
}

代码示例来源:origin: jclehner/rxdroid

@Override
  public boolean onPreferenceClick(Preference preference)
  {
    try
    {
      Backup.createBackup(null, "foobar");
    }
    catch(ZipException e)
    {
      Log.w(TAG, e);
      Toast.makeText(getActivity(), "Error: " + e.getMessage(), Toast.LENGTH_LONG).show();
    }
    return true;
  }
});

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

currSplitFileCounter++;
} catch (ZipException e) {
  throw new IOException(e.getMessage());

代码示例来源:origin: ThisIsLibra/AndroidProjectCreator

/**
 * Works on both ZIP and APK archives
 *
 * @param source ZIP or APK file location
 * @param destination place to extract all files to
 * @throws ZipException if the file is not a ZIP archive
 * @throws IOException if the source file cannot be found
 */
public void extractArchive(String source, String destination) throws ZipException, IOException {
  //Checke if the source folder exists
  if (!new File(source).exists()) {
    throw new IOException("The source file does not exist");
  }
  try {
    ZipFile zipFile = new ZipFile(source);
    zipFile.extractAll(destination);
  } catch (ZipException e) {
    //A message is already provided
    throw new ZipException(e.getMessage());
  }
}

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

public RandomAccessFile startNextSplitFile() throws IOException, FileNotFoundException {
  String currZipFile = zipModel.getZipFile();
  String partFile = null;
  if (currSplitFileCounter == zipModel.getEndCentralDirRecord().getNoOfThisDisk()) {
    partFile = zipModel.getZipFile();
  } else {
    if (currSplitFileCounter >= 9) {
      partFile = currZipFile.substring(0, currZipFile.lastIndexOf(".")) + ".z" + (currSplitFileCounter + 1);
    } else {
      partFile = currZipFile.substring(0, currZipFile.lastIndexOf(".")) + ".z0" + (currSplitFileCounter + 1);
    }
  }
  currSplitFileCounter++;
  try {
    if(!Zip4jUtil.checkFileExists(partFile)) {
      throw new IOException("zip split file does not exist: " + partFile);
    }
  } catch (ZipException e) {
    throw new IOException(e.getMessage());
  }
  return new RandomAccessFile(partFile, InternalZipConstants.READ_MODE);
}

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

/**
 * Closes the input stream and releases any resources.
 * If skipCRCCheck flag is set to true, this method skips CRC Check
 * of the extracted file
 * 
 * @throws IOException
 */
public void close(boolean skipCRCCheck) throws IOException {
  try {
    is.close();
    if (!skipCRCCheck && is.getUnzipEngine() != null) {
      is.getUnzipEngine().checkCRC();
    }
  } catch (ZipException e) {
    throw new IOException(e.getMessage());
  }
}

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

/**
 * Closes the input stream and releases any resources.
 * If skipCRCCheck flag is set to true, this method skips CRC Check
 * of the extracted file
 * 
 * @throws IOException
 */
public void close(boolean skipCRCCheck) throws IOException {
  try {
    is.close();
    if (!skipCRCCheck && is.getUnzipEngine() != null) {
      is.getUnzipEngine().checkCRC();
    }
  } catch (ZipException e) {
    throw new IOException(e.getMessage());
  }
}

代码示例来源:origin: jclehner/rxdroid

public boolean restore(String password)
  {
    if(!isValid())
      throw new IllegalStateException("Invalid backup file");
    synchronized(Database.LOCK_DATA)
    {
      try
      {
        if(password != null)
          mZip.setPassword(password);
        mZip.extractAll(RxDroid.getPackageInfo().applicationInfo.dataDir);
      }
      catch(ZipException e)
      {
        final String msg = e.getMessage();
        if(password != null && msg.toLowerCase(Locale.US).contains("password"))
          return false;
        throw new WrappedCheckedException(e);
      }
      Settings.init(true);
    }
    NotificationReceiver.rescheduleAlarmsAndUpdateNotification(false);
    return true;
  }
}

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

public NativeFile startNextSplitFile() throws IOException, FileNotFoundException {
  NativeStorage currZipFile = zipModel.getZipFile();
  String currZipFileName = currZipFile.getName();
  NativeStorage partFile = null;
  if (currSplitFileCounter == zipModel.getEndCentralDirRecord().getNoOfThisDisk()) {
    partFile = zipModel.getZipFile();
  } else {
    if (currSplitFileCounter >= 9) {
      partFile = currZipFile.getParent().open(currZipFileName.substring(0, currZipFileName.lastIndexOf(".")) + ".z" + (currSplitFileCounter + 1));
    } else {
      partFile = currZipFile.getParent().open(currZipFileName.substring(0, currZipFileName.lastIndexOf(".")) + ".z0" + (currSplitFileCounter + 1));
    }
  }
  currSplitFileCounter++;
  try {
    if(!Zip4jUtil.checkFileExists(partFile)) {
      throw new IOException("zip split file does not exist: " + partFile);
    }
  } catch (ZipException e) {
    throw new IOException(e.getMessage());
  }
  return partFile.read();
}

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

decrypter.decryptData(b, off, count);
} catch (ZipException e) {
  throw new IOException(e.getMessage());

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

private void startNextSplitFile() throws IOException {
  try {
    String zipFileWithoutExt = Zip4jUtil.getZipFileNameWithoutExt(outFile.getName());
    NativeStorage currSplitFile = null;
    NativeStorage zipFileName = new NativeStorage(zipFile);
    
    if (currSplitFileCounter < 9) {
      currSplitFile = outFile.getParent().open(zipFileWithoutExt + ".z0" + (currSplitFileCounter + 1));
    } else {
      currSplitFile = outFile.getParent().open(zipFileWithoutExt + ".z" + (currSplitFileCounter + 1));
    }
    
    raf.close();
    
    if (currSplitFile.exists()) {
      throw new IOException("split file: " + currSplitFile.getName() + " already exists in the current directory, cannot rename this file");
    }
    
    if (!zipFile.renameTo(currSplitFile)) {
      throw new IOException("cannot rename newly created split file");
    }
    
    zipFile = new NativeStorage(zipFileName);
    raf = zipFile.write();
    currSplitFileCounter++;
  } catch (ZipException e) {
    throw new IOException(e.getMessage());
  }
}

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

decrypter.decryptData(b, off, count);
} catch (ZipException e) {
  throw new IOException(e.getMessage());

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