Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.SubMonitor.newChild()


    BasicDiagnostic diag = new BasicDiagnostic();
    SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
   
    IMetadataRepository metadataRepository;
    try {
      metadataRepository = metadataRepositoryManager.loadRepository(uri, subMonitor.newChild(80));
      SubMonitor loopMonitor = subMonitor.newChild(20).setWorkRemaining(unresolvedIUs.size());
      for (UnresolvedIU iu : unresolvedIUs) {
        if (monitor.isCanceled()) {
          break;
        }
View Full Code Here


      SubMonitor loopMonitor = subMonitor.newChild(20).setWorkRemaining(unresolvedIUs.size());
      for (UnresolvedIU iu : unresolvedIUs) {
        if (monitor.isCanceled()) {
          break;
        }
        Set<IInstallableUnit> results = metadataRepository.query(iu.getQuery(), loopMonitor.newChild(1)).toUnmodifiableSet();
        if (!results.isEmpty()) {
          IInstallableUnit unit =  results.iterator().next();
          if (iu.isLazyRange() && unit instanceof InstallableUnit) {
            ((InstallableUnit)unit).setVersion(Version.create("0.0.0"));
          }
View Full Code Here

      subMonitor.worked(5);
     
      if (subMonitor.isCanceled()) {
        ret.merge(Diagnostic.CANCEL_INSTANCE);
      } else {
        Diagnostic diagnostic = resolvedTargetPlatform.resolve(repositoryManager, subMonitor.newChild(90));
        if (diagnostic.getSeverity() >= Diagnostic.WARNING) {
          ret.merge(diagnostic);
        }
        if (subMonitor.isCanceled()) {
          ret.merge(Diagnostic.CANCEL_INSTANCE);
View Full Code Here

    // download
    FileOutputStream fout = null;
    try {
      InputStream in = url.openStream();
      fout = new FileOutputStream(temp);
      download(in, fout, progress.newChild(500), name, archiveSize);
      progress.setWorkRemaining(500);
    } catch (Exception e) {
      if (monitor != null)
        monitor.done();
//      if (Trace.WARNING) {
View Full Code Here

   
    FileInputStream in = null;
    try {
      in = new FileInputStream(temp);
      if (name.endsWith("zip")) //$NON-NLS-1$
        unzip(in, path, progress.newChild(500));
      else if (name.endsWith("tar")) //$NON-NLS-1$
        untar(in, path, progress.newChild(500));
      else if (name.endsWith("tar.gz")) { //$NON-NLS-1$
        File tarFile = File.createTempFile("runtime", ".tar"); //$NON-NLS-1$ //$NON-NLS-2$
        tarFile.deleteOnExit();
View Full Code Here

    try {
      in = new FileInputStream(temp);
      if (name.endsWith("zip")) //$NON-NLS-1$
        unzip(in, path, progress.newChild(500));
      else if (name.endsWith("tar")) //$NON-NLS-1$
        untar(in, path, progress.newChild(500));
      else if (name.endsWith("tar.gz")) { //$NON-NLS-1$
        File tarFile = File.createTempFile("runtime", ".tar"); //$NON-NLS-1$ //$NON-NLS-2$
        tarFile.deleteOnExit();
        String tarName = name;
       
View Full Code Here

        progress.subTask(NLS.bind(Messages.InstallableRuntime2_TaskUncompressing, tarName));
        int tempSize = Integer.MAX_VALUE;
        if (temp.length() < Integer.MAX_VALUE)
          tempSize = (int)temp.length();
       
        ungzip(in, tarFile, progress.newChild(250), tempSize);
        progress.setWorkRemaining(250);
        if (!progress.isCanceled()) {
          in = new FileInputStream(tarFile);
          untar(in, path, progress.newChild(250));
        }
View Full Code Here

       
        ungzip(in, tarFile, progress.newChild(250), tempSize);
        progress.setWorkRemaining(250);
        if (!progress.isCanceled()) {
          in = new FileInputStream(tarFile);
          untar(in, path, progress.newChild(250));
        }
      }
    } catch (Exception e) {
//      if (Trace.SEVERE) {
//        Trace.trace(Trace.STRING_SEVERE, "Error uncompressing runtime", e);
View Full Code Here

      if (name != null && name.length() > 0) {
        if (entry.isDirectory())
          path.append(name).toFile().mkdirs();
        else {
          FileOutputStream fout = new FileOutputStream(path.append(name).toFile());
          copyWithSize(zin, fout, progress.newChild(1), (int)entry.getSize());
          fout.close();
          // if count is not known, use infinite logarithmic progress
          if (fileCnt <= 0)
            progress.setWorkRemaining(DEFAULT_FILE_COUNT);
        }
View Full Code Here

            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

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.