Examples of findFilesForLocationURI()


Examples of org.eclipse.core.resources.IWorkspaceRoot.findFilesForLocationURI()

  }
  protected IResource getResource(IPath path) {
    if (path != null) {
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      // look for files or folders with the given path
      IFile[] files = root.findFilesForLocationURI(path.toFile().toURI());
      if (files.length > 0) {
        return files[0];
      }
      IContainer[] containers = root.findContainersForLocationURI(path.toFile().toURI());
      if (containers.length > 0) {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot.findFilesForLocationURI()

                if( contentProvider instanceof WorkspaceContentProvider )
                {
                    final URI uri = currentPathAbsolute.toFile().toURI();
                    final IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
                   
                    final IFile[] files = wsroot.findFilesForLocationURI( uri );
                   
                    if( files.length > 0 )
                    {
                        final IFile file = files[ 0 ];
                       
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot.findFilesForLocationURI()

    ExpandableResourceDelta newDelta= ExpandableResourceDelta.duplicate(delta);
   
    // add the additional files
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    for (File file: files) {
      for (IFile resource: workspaceRoot.findFilesForLocationURI(file.toURI())) {
        // filter only the resources on the right project, to support nested projects
        if (resource.getProject() == project) {
          newDelta.addChangedResource(resource);
        }
      }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot.findFilesForLocationURI()

            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();

            StringSubstitution stringSubstitution = getStringSubstitution(root);
            try {
                path = stringSubstitution.performStringSubstitution(path, false);
                IFile[] files = root.findFilesForLocationURI(new File(path).toURI());
                if (files.length > 0) {
                    file = files[0];
                }
            } catch (CoreException e) {
                Log.log(e);
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot.findFilesForLocationURI()

    Set<String> preselectionCandidates = new LinkedHashSet<String>();
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    // iterate through all the files that may be committed
    for (String fileName : files) {
      URI uri = new File(repo.getWorkTree(), fileName).toURI();
      IFile[] workspaceFiles = root.findFilesForLocationURI(uri);
      if (workspaceFiles.length > 0) {
        IFile file = workspaceFiles[0];
        for (IResource resource : selectedResources) {
          // if any selected resource contains the file, add it as a
          // preselection candidate
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot.findFilesForLocationURI()

      Collection<String> files) {
    CheckResult result = new CheckResult();
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    String workTreePath = repository.getWorkTree().getAbsolutePath();
    for (String filePath : files) {
      IFile[] filesForLocation = root.findFilesForLocationURI(new File(
          workTreePath, filePath).toURI());
      if (filesForLocation.length == 0) {
        result.addEntry(filePath, new CheckResultEntry(false, false));
        continue;
      }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot.findFilesForLocationURI()

    return (IFile[]) existentFiles.toArray(new IFile[existentFiles.size()]);
  }

  static IFile getWorkspaceFile(IFileStore fileStore) {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    IFile[] files = root.findFilesForLocationURI(fileStore.toURI());
    files = filterNonExistentFiles(files);
    if (files == null || files.length == 0)
      return null;

    // for now only return the first file
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot.findFilesForLocationURI()

    super.performSaveAs(progressMonitor);
  }

  private IFile getWorkspaceFile(IFileStore fileStore) {
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile[] files = workspaceRoot.findFilesForLocationURI(fileStore.toURI());
    if(files != null && files.length == 1)
      return files[0];
    return null;
  }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRoot.findFilesForLocationURI()

  }

  private IFile getWorkspaceFile(IFileStore fileStore) {
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    IFile[] files = workspaceRoot.findFilesForLocationURI(fileStore.toURI());
    if(files != null && files.length == 1)
      return files[0];
    return null;
  }
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.