Examples of FileHeader


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

Examples of com.github.junrar.rarfile.FileHeader

        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

Examples of com.github.junrar.rarfile.FileHeader

      @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

Examples of com.sleepycat.je.log.FileHeader

            headerBuf.flip();
            LogEntry fileHeaderEntry =
                LogEntryType.LOG_FILE_HEADER.getNewLogEntry();
            fileHeaderEntry.readEntry(envImpl, header, headerBuf);
            FileHeader fileHeaderItem =
                (FileHeader) fileHeaderEntry.getMainItem();

            /* Log version in the file header applies to all other entries. */
            logVersion = fileHeaderItem.getLogVersion();

            entryStart += header.getSize() + maxSize;
            state = State.INIT;
        }

View Full Code Here

Examples of com.sleepycat.je.log.FileHeader

     */
    public void readEntry(EnvironmentImpl envImpl,
                          LogEntryHeader header,
                          ByteBuffer entryBuffer) {
        super.readEntry(envImpl, header, entryBuffer);
        FileHeader entry = (FileHeader) getMainItem();
        header.setFileHeaderVersion(entry.getLogVersion());
    }
View Full Code Here

Examples of com.sleepycat.je.log.FileHeader

     */
    public void readEntry(LogEntryHeader header,
                          ByteBuffer entryBuffer,
                          boolean readFullItem) {
        super.readEntry(header, entryBuffer, readFullItem);
        FileHeader entry = (FileHeader) getMainItem();
        header.setFileHeaderVersion(entry.getLogVersion());
    }
View Full Code Here

Examples of com.sleepycat.je.log.FileHeader

            headerBuf.flip();
            LogEntry fileHeaderEntry =
                LogEntryType.LOG_FILE_HEADER.getNewLogEntry();
            fileHeaderEntry.readEntry(header, headerBuf,
                                      true /*readFullItem*/);
            FileHeader fileHeaderItem =
                (FileHeader) fileHeaderEntry.getMainItem();

            /* Log version in the file header applies to all other entries. */
            logVersion = fileHeaderItem.getLogVersion();

            entryStart += header.getSize() + maxSize;
            state = State.INIT;
        }

View Full Code Here

Examples of de.innosystec.unrar.rarfile.FileHeader

          - BlockHeader.BaseBlockSize
          - BlockHeader.blockHeaderSize;
        byte[] fileHeaderBuffer = new byte[toRead];
        int fhsize = rof.readFully(fileHeaderBuffer, toRead);

        FileHeader fh = new FileHeader(blockHead, fileHeaderBuffer);
        // if (DEBUG) {
        // fh.print();
        // }
        headers.add(fh);
        newpos = fh.getPositionInFile() + fh.getHeaderSize()
          + fh.getFullPackSize();
        rof.setPosition(newpos);
        break;

    case ProtectHeader:
        toRead = blockHead.getHeaderSize()
View Full Code Here

Examples of de.innosystec.unrar.rarfile.FileHeader

      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    if(a!=null){
      a.getMainHeader().print();
      FileHeader fh = a.nextFileHeader();
      while(fh!=null){ 
        try {
          File out = new File("/home/Avenger/testdata/"+fh.getFileNameString().trim());
          System.out.println(out.getAbsolutePath());
          FileOutputStream os = new FileOutputStream(out);
          a.extractFile(fh, os);
          os.close();
        } catch (FileNotFoundException e) {
View Full Code Here

Examples of de.innosystec.unrar.rarfile.FileHeader

    private Volume() {
    }

    public static boolean mergeArchive(Archive archive, ComprDataIO dataIO)
            throws IOException {
        FileHeader hd = dataIO.getSubHeader();
        if (hd.getUnpVersion()>=20 &&
                hd.getFileCRC()!=0xffffffff &&
                dataIO.getPackedCRC()!=~hd.getFileCRC()) {
            System.err.println("Data Bad CRC");
        }

        boolean oldNumbering = !archive.getMainHeader().isNewNumbering() ||
                archive.isOldFormat();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.