Examples of TarEntry


Examples of org.eclipse.equinox.internal.p2.core.helpers.TarEntry

    SubMonitor progress = SubMonitor.convert(monitor, (fileCnt > 0) ? fileCnt : 500);
    String archivePath = getArchivePath();
    BufferedInputStream bin = new BufferedInputStream(in);
    try {
      TarInputStream zin = new TarInputStream(bin);
      TarEntry entry = zin.getNextEntry();
      while (entry != null) {
        String name = entry.getName();
        progress.subTask(NLS.bind(Messages.InstallableRuntime2_TaskUncompressing, name));
        if (archivePath != null && name.startsWith(archivePath)) {
          name = name.substring(archivePath.length());
          if (name.length() > 1)
            name = name.substring(1);
        }
       
        if (name != null && name.length() > 0) {
          if (entry.getFileType() == TarEntry.DIRECTORY)
            path.append(name).toFile().mkdirs();
          else {
            File dir = path.append(name).removeLastSegments(1).toFile();
            if (!dir.exists())
              dir.mkdirs();
           
            FileOutputStream fout = new FileOutputStream(path.append(name).toFile());
            copyWithSize(zin, fout, progress.newChild(1), (int)entry.getSize());
            fout.close();
            if (fileCnt <= 0)
              progress.setWorkRemaining(500);
          }
        }
View Full Code Here

Examples of org.eclipse.php.internal.core.tar.TarEntry

   *            The path representing the container
   * @return The element represented by this pathname (it may have already
   *         existed)
   */
  protected TarEntry createContainer(IPath pathname) {
    TarEntry existingEntry = (TarEntry) directoryEntryCache.get(pathname);
    if (existingEntry != null) {
      return existingEntry;
    }

    TarEntry parent;
    if (pathname.segmentCount() == 1) {
      parent = root;
    } else {
      parent = createContainer(pathname.removeLastSegments(1));
    }
    TarEntry newEntry = new TarEntry(pathname.toString());
    newEntry.setFileType(TarEntry.DIRECTORY);
    directoryEntryCache.put(pathname, newEntry);
    List childList = new ArrayList();
    children.put(newEntry, childList);

    List parentChildList = (List) children.get(parent);
View Full Code Here

Examples of org.xeustechnologies.jtar.TarEntry

            // Files to tar
            for (File f : content) {

                try {
                    out.putNextEntry(new TarEntry(f, f.getName()));
                    BufferedInputStream origin = new BufferedInputStream(new FileInputStream(f));

                    int count;
                    byte data[] = new byte[2048];
                    while ((count = origin.read(data)) != -1) {
View Full Code Here

Examples of org.xeustechnologies.jtar.TarEntry

    public void doDecompression(String tarFile,String destFolder) {
        TarInputStream tis = null;
        try {
            tis = new TarInputStream(new BufferedInputStream(new FileInputStream(tarFile)));
            TarEntry entry;
            try {
                while ((entry = tis.getNextEntry()) != null) {
                    int count;
                    byte data[] = new byte[2048];
                   
                    FileOutputStream fos = new FileOutputStream(destFolder + "/" + entry.getName());
                    BufferedOutputStream dest = new BufferedOutputStream(fos);
                   
                    while ((count = tis.read(data)) != -1) {
                        dest.write(data, 0, count);
                    }
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.