Package org.eclipse.core.internal.resources

Examples of org.eclipse.core.internal.resources.Resource


     *
     * @param file
     * @throws CoreException
     */
    private void removeCaseSensitiveDupFile(IFile file) throws CoreException {
        Resource fileResource = (Resource) file;
        // now look for a matching case variant in the tree
        IResource variant = fileResource.findExistingResourceVariant(fileResource.getFullPath());
        if (variant == null) {
            return;
        }

        variant.delete(true, new NullProgressMonitor());
View Full Code Here


  /**
   * Deletes a file from both the workspace resource tree and the file system.
   */
  protected void delete(UnifiedTreeNode node, boolean shouldKeepHistory) {
    Resource target = (Resource) node.getResource();
    try {
      final boolean deleteLocalFile = !target.isLinked() && node.existsInFileSystem();
      IFileStore localFile = deleteLocalFile ? node.getStore() : null;
      if (deleteLocalFile && shouldKeepHistory)
        recursiveKeepHistory(target.getLocalManager().getHistoryStore(), node);
      node.removeChildrenFromTree();
      //delete from disk
      int work = ticks < 0 ? 0 : ticks;
      ticks -= work;
      if (deleteLocalFile)
        localFile.delete(EFS.NONE, Policy.subMonitorFor(monitor, work));
      else
        monitor.worked(work);
      //delete from tree
      if (node.existsInWorkspace())
        target.deleteResource(true, status);
    } catch (CoreException e) {
      status.add(e.getStatus());
      //  delete might have been partly successful, so refresh to ensure in sync
      try {
        target.refreshLocal(IResource.DEPTH_INFINITE, null);
      } catch (CoreException e1) {
        //ignore secondary failure - we are just trying to cleanup from first failure
      }
    }
  }
View Full Code Here

    return false;
  }

  public boolean visit(UnifiedTreeNode node) {
    Policy.checkCanceled(monitor);
    Resource target = (Resource) node.getResource();
    if (shouldSkip(target)) {
      removeFromSkipList(target);
      int skipTicks = target.countResources(IResource.DEPTH_INFINITE, false);
      monitor.worked(skipTicks);
      ticks -= skipTicks;
      return false;
    }
    if (isAncestorOfResourceToSkip(target))
View Full Code Here

TOP

Related Classes of org.eclipse.core.internal.resources.Resource

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.