Package org.eclipse.core.resources

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


            {
                final InputStream sourceSchemaFileInputStream = sourceSchemaFile.getContents();
               
                try
                {
                    targetSchemaFile.refreshLocal( IResource.DEPTH_ZERO, new NullProgressMonitor() );
                   
                    create( targetSchemaFile.getParent() );
                   
                    if( targetSchemaFile.exists() )
                    {
View Full Code Here


              {
                  mkdirs(layoutFolder);
                  layoutIFolder.refreshLocal(IResource.DEPTH_ONE, null);
              }
              IFile layoutFile = layoutIFolder.getFile(fileName);
              layoutFile.refreshLocal(IResource.DEPTH_ONE, null);
              return layoutFile;
      }
    }
    return null;
  }
View Full Code Here

          try {
            os = new BufferedOutputStream(new FileOutputStream(pomFile));
            MavenPlugin.getMaven().writeModel(model, os);
            IFile pomIFile = project.getProject().getFile("pom.xml");
            if (pomIFile != null){
              pomIFile.refreshLocal(IResource.DEPTH_INFINITE, monitor);
            }
            runnable.run(new SubProgressMonitor(monitor, 2));
          } catch (Exception ex) {
            Activator.getLogger().error(ex);
          } finally {
View Full Code Here

                                protected IStatus run(IProgressMonitor monitor) {
                                    try {
                                        file.setCharset(encoding, monitor);
                                        ((TextFileDocumentProvider) getDocumentProvider()).setEncoding(input, encoding);
                                        //refresh it...
                                        file.refreshLocal(IResource.DEPTH_INFINITE, null);
                                    } catch (CoreException e) {
                                        Log.log(e);
                                    }
                                    return Status.OK_STATUS;
                                }
View Full Code Here

                }
            }
            //Before 1.4
            settingsFile = projectContainer.getFile(new Path(projectName + "/settings.py"));

            settingsFile.refreshLocal(IResource.DEPTH_ZERO, null);
            docFromResource = FileUtilsFileBuffer.getDocFromResource(settingsFile);
            if (docFromResource == null) {
                throw new RuntimeException("Error creating Django project.\n" + "settings.py file not created.\n"
                        + "Stdout: " + output.o1 + "\n" + "Stderr: " + output.o2);
            }
View Full Code Here

            IFile file = (IFile) resource;

            try {
                if (!file.isSynchronized(IResource.DEPTH_ZERO)) {
                    file.refreshLocal(IResource.DEPTH_ZERO, new NullProgressMonitor());
                }
                IPath path = file.getFullPath();

                IDocument doc = getDocFromPath(path);
                if (doc == null) {
View Full Code Here

      CommandLine commandLine, String project, String file)
    throws Exception
  {
    IFile ifile = ProjectUtils.getFile(
        ProjectUtils.getProject(project, true), file);
    ifile.refreshLocal(IResource.DEPTH_INFINITE, null);

    IStructuredModel model =
      StructuredModelManager.getModelManager().getModelForRead(ifile);

    if (viewer == null) {
View Full Code Here

  }

  private IFile getSynchronizedFile(IResource resource) throws CoreException {
    IFile file = ((IFile) resource);
    if (!file.isSynchronized(0))
      file.refreshLocal(0, null);

    return file;
  }

  private void logException(Exception e) {
View Full Code Here

    IPath zarFilePath = zarFile.getLocation();
    // delete file and refresh. Deleting using the resource would trigger
    // GitMoveDeleteHook which removes the file from the index
    assertTrue("could not delete file " + zarFilePath.toOSString(),
        zarFilePath.toFile().delete());
    zarFile.refreshLocal(0, null);

    assertFalse(project.getProject().getFile("zar/b.txt").exists());

    IFile[] filesToCommit = new IFile[] { project.getProject().getFile("zar/b.txt") };
    commitOperation = new CommitOperation(filesToCommit, null, TestUtils.AUTHOR, TestUtils.COMMITTER, "first commit");
View Full Code Here

    String quotedProjectName = Pattern.quote(project.getName());
    relativePath = relativePath.replaceFirst(quotedProjectName, "");

    IFile iFile = project.getFile(relativePath);
    iFile.refreshLocal(0, null);

    return iFile;
  }

  public void dispose() {
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.