Package org.eclipse.core.resources

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


      if (towrite.exists()) {
        // overwrite it
        towrite.setContents(url.openStream(), true, true, new NullProgressMonitor());
      } else {
        // copy it
        towrite.create(url.openStream(), true, new NullProgressMonitor());
      }
     
      // notify listeners
      fileCopied( new File(url.toExternalForm()), towrite.getLocation().toFile() );
    }
View Full Code Here


          // write document anyway
          // out.create(source, true, monitor);
          saveDocument(document, out.getLocation().toFile());
          outParsed.create(new StringBufferInputStream(parsed),
              true, monitor);
          outLatex.create(new StringBufferInputStream(latex),
              true, monitor);

          throw new TermParseException("While trying to parse '" + f + "'...: " + e.getMessage(), e);
        }
      }
View Full Code Here

      System.out.println("Writing to '" + outParsed + "'...");
      outParsed.create(new StringBufferInputStream(parsed),
          true, monitor);
      // write out parsed rules
      System.out.println("Writing to '" + outLatex + "'...");
      outLatex.create(new StringBufferInputStream(latex),
          true, monitor);

      System.out.println("---");
      System.out.println("loops factory in '" + f + "':");
      GraphLoops loops = calculateFactoryLoops(fileProgram);
View Full Code Here

    // write to file
    IFile outFile = getProject().getFile("strat.pl");
    InputStream stream = new ByteArrayInputStream(pl.toString().getBytes("UTF-8"));
    System.out.println("Writing " + outFile + "...");
    outFile.create(stream, true, monitor);
  }

  /**
   * Get a list of all the unique elements mentioned in both the
   * head and body of this rule.
View Full Code Here

    out.append("\n</ol></html>\n");

    // output to name-logic.html
    IFile outFile = getProject().getFile(name + ".logic.html");
    InputStream source = new ByteArrayInputStream(out.toString().getBytes("UTF-8"));
    outFile.create(source, true, monitor);

    return logicRules;
  }

  public Document firstDocument(Map<?,Document> map) {
View Full Code Here

      } else {
        try {
          monitor.beginTask(TextEditorMessages.FileDocumentProvider_task_saving, 2000);
          ContainerCreator creator = new ContainerCreator(file.getWorkspace(), file.getParent().getFullPath());
          creator.createContainer(new SubProgressMonitor(monitor, 1000));
          file.create(stream, false, new SubProgressMonitor(monitor, 1000));
        }
        finally {
          monitor.done();
        }
      }
View Full Code Here

            writer.write(saved, policy);
            InputStream input = new ByteArrayInputStream(saved.toString().getBytes("UTF-8"));
            if (file.exists()) {
                file.setContents(input, IResource.KEEP_HISTORY, monitor);
            } else {
                file.create(input, IResource.KEEP_HISTORY, monitor);
            }
        } catch (UnsupportedEncodingException e) {
            // Needs to be catch due to getBytes("UTF-8")
            // Should never get an UnsupportedEncodingException cause UTF-8 is valid encoding
            logger.error("encoding-not-supported",e);
View Full Code Here

    IPackageFragmentRoot[] roots = javaProject.getPackageFragmentRoots();
    for(int i=0;i<roots.length;i++){
      if(roots[i].getResource() instanceof IFolder){
        IFile file = ((IFolder) roots[i].getResource()).getFile("cayenne.xml");
        try {
          file.create(ClickPlugin.getDefault().getBundle().getEntry(
              ClickFacetUtil.CAYENNE_DIR + "/cayenne.xml").openStream(),
              true, monitor);
        } catch(Exception ex){
          ClickPlugin.log(ex);
        }
View Full Code Here

                InputStream is = new FileInputStream(orgFile);
                IFile file = IOUtils.getAdjacentFile(definitionFile, MappingContentProvider.ORG_XML_FILE_NAME);
                if (file.exists()) {
                    file.setContents(is, true, false, null);
                } else {
                    file.create(is, true, null);
                }
            }
            File mappingFile = MappingContentProvider.INSTANCE.getMappingFile();
            if (mappingFile.exists()) {
                InputStream is = new FileInputStream(mappingFile);
View Full Code Here

                InputStream is = new FileInputStream(mappingFile);
                IFile file = IOUtils.getAdjacentFile(definitionFile, MappingContentProvider.MAPPING_XML_FILE_NAME);
                if (file.exists()) {
                    file.setContents(is, true, false, null);
                } else {
                    file.create(is, true, null);
                }
            }

            performInfopathFormsSynchronization(definition, definitionFile);
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.