Package com.github.junrar.rarfile

Examples of com.github.junrar.rarfile.FileHeader


  if (arch != null) {
      if (arch.isEncrypted()) {
    logger.warn("archive is encrypted cannot extreact");
    return;
      }
      FileHeader fh = null;
      while (true) {
    fh = arch.nextFileHeader();
    if (fh == null) {
        break;
    }
    if (fh.isEncrypted()) {
        logger.warn("file is encrypted cannot extract: "
          + fh.getFileNameString());
        continue;
    }
    logger.info("extracting: " + fh.getFileNameString());
    try {
        if (fh.isDirectory()) {
      createDirectory(fh, destination);
        } else {
      File f = createFile(fh, destination);
      OutputStream stream = new FileOutputStream(f);
      arch.extractFile(fh, stream);
View Full Code Here


        if (nextVolume == null) {
          nextVolumeMissing = true;
          return -1;
        }

        FileHeader hd = this.getSubHeader();
        if (hd.getUnpVersion() >= 20 && hd.getFileCRC() != 0xffffffff
            && this.getPackedCRC() != ~hd.getFileCRC()) {
          throw new RarException(RarExceptionType.crcError);
        }
        UnrarCallback callback = archive.getUnrarCallback();
        if ((callback != null)
            && !callback.isNextVolumeReady(nextVolume)) {
View Full Code Here

      @Override
      public void run() {
        Archive rarFile = null;
        try {
          rarFile = new Archive(file);
          FileHeader header = null;
          for (FileHeader fh : rarFile.getFileHeaders()) {
            if (fh.getFileNameString().equals(fileHeaderName)) {
              header = fh;
              break;
            }
          }
          if (header != null) {
            LOGGER.trace("Starting the extraction of " + header.getFileNameString());
            rarFile.extractFile(header, out);
          }
        } catch (RarException | IOException e) {
          LOGGER.debug("Unpack error, maybe it's normal, as backend can be terminated: " + e.getMessage());
        } finally {
View Full Code Here

      public void run() {
        Archive rarFile = null;
        try {
          rarFile = new Archive(file);
          FileHeader header = null;
          for (FileHeader fh : rarFile.getFileHeaders()) {
            if (fh.getFileNameString().equals(fileHeaderName)) {
              header = fh;
              break;
            }
          }
          if (header != null) {
            logger.trace("Starting the extraction of " + header.getFileNameString());
            rarFile.extractFile(header, out);
          }
        } catch (Exception e) {
          logger.debug("Unpack error, maybe it's normal, as backend can be terminated: " + e.getMessage());
        } finally {
View Full Code Here

TOP

Related Classes of com.github.junrar.rarfile.FileHeader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.