Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IFile.refreshLocal()


          Services.getMessage("project.file.mismatch", file, path));
    }*/
    //String file = file.substring(path.length());

    IFile ifile = project.getFile(file);
    ifile.refreshLocal(IResource.DEPTH_INFINITE, null);

    // invoke any nature specific file refreshing
    String[] natures = ProjectNatureFactory.getProjectNatures(project);
    for (String nature : natures){
      ProjectManager manager = ProjectManagement.getProjectManager(nature);
View Full Code Here


    final IFile file = AntUtil.getFileForLocation(
        ProjectUtils.getFilePath(project, antFile), null);
    if (file == null) {
      throw new RuntimeException("Invalid project or file location");
    }
    file.refreshLocal(IResource.DEPTH_INFINITE, null);

    IDocument doc = ProjectUtils.getDocument(project, antFile);
    //final String filepath = ProjectUtils.getFilePath(project, antFile);

    LocationProvider provider = new LocationProvider(null) {
View Full Code Here

      }

  } catch (CoreException e) {
      // If the file already existed locally, just refresh to get contents
      if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED)
    newFile.refreshLocal(IResource.DEPTH_ZERO, null);
      else
    throw e;
  }

  return newFile;
View Full Code Here

      } catch (final SWTException e) {
        e.printStackTrace();
        MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error during image saving", e
            .getMessage());
      }
      file.refreshLocal(1, null);
    } catch (final CoreException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

    IFile facesConfig = getFacesconfig(project);
      String version = null;
    if (facesConfig != null) {
      InputStream in = null;
      try {
        facesConfig.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
        in = facesConfig.getContents();
        FacesConfigQuickPeek peek = new FacesConfigQuickPeek(in);
        version = peek.getVersion();
      } catch (CoreException e) {
        // ignore
View Full Code Here

    try {
      if (bpmnFile.exists() == false) {
        model.setBpmnModel(new BpmnModel());
        model.addMainProcess();
        bpmnFile.createNewFile();
        dataFile.refreshLocal(IResource.DEPTH_INFINITE, null);
      } else {
        FileInputStream fileStream = new FileInputStream(bpmnFile);
        XMLInputFactory xif = XMLInputFactory.newInstance();
        InputStreamReader in = new InputStreamReader(fileStream, "UTF-8");
        XMLStreamReader xtr = xif.createXMLStreamReader(in);
View Full Code Here

        file.setContents(content, true, true, monitor);
      } else {
        monitor.beginTask("create", 10);
        file.create(content, true, monitor);
      }
      file.refreshLocal(IResource.DEPTH_INFINITE, null);
      monitor.worked(10);
    } catch (CoreException e) {
      // TODO
      e.printStackTrace();
      // addProblemToDiagram(diagram,
View Full Code Here

        // path in project that is the same as the external file's path to avoid collision
        // without need to create new names
        linkFile = project.getFile(uri.getPath());
      }
      if(linkFile.exists())
        linkFile.refreshLocal(1, null); // don't know if needed (or should be avoided...)
      else {
        // create the link
        createLink(project, linkFile, uri);
      }
      return linkFile;
View Full Code Here

      }
      else {
        IFile file= (IFile) workspace.newResource(filePath, IResource.FILE);
        if(null == file) return;
        try {
          file.refreshLocal(IResource.DEPTH_ZERO, progressMonitor);
          openEditor(file);
        }
        catch(CoreException cex) {
          ; // nothing I can do about it
        }
View Full Code Here

        // path in project that is the same as the external file's path to avoid collision
        // without need to create new names
        linkFile = project.getFile(uri.getPath());
      }
      if(linkFile.exists())
        linkFile.refreshLocal(1, null); // don't know if needed (or should be avoided...)
      else {
        // create the link
        createLink(project, linkFile, uri);
      }
      return linkFile;
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.