Examples of ISimpleInArchive


Examples of net.sf.sevenzipjbinding.simple.ISimpleInArchive

        try {
          //byte data[] = new byte[65536];
          RandomAccessFile rf = new RandomAccessFile(file, "r");

          arc = SevenZip.openInArchive(null, (IInStream) new RandomAccessFileInStream(rf));
          ISimpleInArchive simpleInArchive = arc.getSimpleInterface();
          ISimpleInArchiveItem realItem = null;

          for (ISimpleInArchiveItem item : simpleInArchive.getArchiveItems()) {
            if (item.getPath().equals(zeName)) {
              realItem = item;
              break;
            }
          }
View Full Code Here

Examples of net.sf.sevenzipjbinding.simple.ISimpleInArchive

    file = f;
    setLastModified(file.lastModified());
    try {
      RandomAccessFile rf = new RandomAccessFile(f, "r");
      arc = SevenZip.openInArchive(null, (IInStream) new RandomAccessFileInStream(rf));
      ISimpleInArchive simpleInArchive = arc.getSimpleInterface();

      for (ISimpleInArchiveItem item : simpleInArchive.getArchiveItems()) {
        LOGGER.debug("found " + item.getPath() + " in arc " + file.getAbsolutePath());

        // Skip folders for now
        if (item.isFolder()) {
          continue;
View Full Code Here

Examples of net.sf.sevenzipjbinding.simple.ISimpleInArchive

    public static Map<String, InputStream> DecompressRar(InputStream inStream) {
        try {
            final Map<String, InputStream> mapFiles = new HashMap<String, InputStream>();

            ISevenZipInArchive inArchive = SevenZip.openInArchive(null, new sevenZipByteInputStream(InputToByte(inStream)));
            ISimpleInArchive simpleRar = inArchive.getSimpleInterface();
            for (final ISimpleInArchiveItem item : simpleRar.getArchiveItems()) {
                item.extractSlow(new ISequentialOutStream() {
                        public int write(byte[] data) throws SevenZipException {
                            mapFiles.put(item.getPath(), new ByteArrayInputStream(data));
                            return data.length; // Return amount of proceed data
                        }
View Full Code Here

Examples of net.sf.sevenzipjbinding.simple.ISimpleInArchive

            int numItems = inArchive.getNumberOfItems();
            logger.log(Level.INFO, "Count of items in archive: {0}: {1}", new Object[]{archiveFile.getName(), numItems}); //NON-NLS
            progress.start(numItems);
            progressStarted = true;

            final ISimpleInArchive simpleInArchive = inArchive.getSimpleInterface();

            //setup the archive local root folder
            final String uniqueArchiveFileName = getUniqueName(archiveFile);
            final String localRootAbsPath = getLocalRootAbsPath(uniqueArchiveFileName);
            final File localRoot = new File(localRootAbsPath);
            if (!localRoot.exists()) {
                try {
                    localRoot.mkdirs();
                } catch (SecurityException e) {
                    logger.log(Level.SEVERE, "Error setting up output path for archive root: {0}", localRootAbsPath); //NON-NLS
                    //bail
                    return unpackedFiles;
                }
            }

            //initialize tree hierarchy to keep track of unpacked file structure
            UnpackedTree unpackedTree = new UnpackedTree(moduleDirRelative + "/" + uniqueArchiveFileName, archiveFile);

            long freeDiskSpace = services.getFreeDiskSpace();

            //unpack and process every item in archive
            int itemNumber = 0;
            for (ISimpleInArchiveItem item : simpleInArchive.getArchiveItems()) {
                String pathInArchive = item.getPath();
               
                if (pathInArchive == null || pathInArchive.isEmpty()) {
                    //some formats (.tar.gz) may not be handled correctly -- file in archive has no name/path
                    //handle this for .tar.gz and tgz but assuming the child is tar,
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.