Package org.eclipse.core.resources

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


    private void createPOM(IJavaProject project, IProgressMonitor monitor) throws CoreException {
      String fileName = "org/jbpm/eclipse/wizard/project/maven-pom.xml.template";
        IFile file = project.getProject().getFile("pom.xml");
        InputStream inputstream = getClass().getClassLoader().getResourceAsStream(fileName);
        if (!file.exists()) {
            file.create(inputstream, true, monitor);
        } else {
            file.setContents(inputstream, true, false, monitor);
        }
    }
View Full Code Here


    return setup;
  }

  protected static IFile createFile(String data) throws Exception {
    IFile testFile = project.getFile("test" + (++count) + ".php");
    testFile.create(new ByteArrayInputStream(data.getBytes()), true, null);
    return testFile;
  }
}
View Full Code Here

    @Test
    public void makeBuilderShouldWork() throws CoreException {
        ensureNoAppSrcExists();
        final IFolder folder = (IFolder) prj.findMember("src");
        final IFile app = folder.getFile("builders.app.src");
        app.create(
                new StringBufferInputStream("{application, builders,[{vsn, \"1\"}]}."),
                true, null);
        try {
            testBuilder(BuilderTool.MAKE);
            testClean(BuilderTool.MAKE);
View Full Code Here

    @Test
    public void rebarBuilderShouldWork() throws CoreException {
        ensureNoAppSrcExists();
        final IFolder folder = (IFolder) prj.findMember("src");
        final IFile app = folder.getFile("builders.app.src");
        app.create(
                new StringBufferInputStream("{application, builders,[{vsn, \"1\"}]}."),
                true, null);
        try {
            testBuilder(BuilderTool.REBAR);
View Full Code Here

        final IFolder folder = wproject.getFolder(inc);
        final IFile header = folder.getFile(name);
        try {
            final EmptyInputStream source = new EmptyInputStream();
            try {
                header.create(source, true, null);
            } finally {
                try {
                    source.close();
                } catch (final IOException e) {
                }
View Full Code Here

        try {
            final InputStream stream = openContentStream();
            if (file.exists()) {
                file.setContents(stream, true, true, monitor);
            } else {
                file.create(stream, true, monitor);
            }
            stream.close();
        } catch (final IOException e) {
        }
        monitor.worked(1);
View Full Code Here

        try {
            final InputStream stream = openContentStream(skeleton);
            if (file.exists()) {
                file.setContents(stream, true, true, monitor);
            } else {
                file.create(stream, true, monitor);
            }
            stream.close();
        } catch (final IOException e) {
        }
        monitor.worked(1);
View Full Code Here

    final File f = new File(_oSString);
    f.delete();
    Charset _defaultCharset = Charset.defaultCharset();
    byte[] _bytes = contents.getBytes(_defaultCharset);
    ByteArrayInputStream _byteArrayInputStream = new ByteArrayInputStream(_bytes);
    file.create(_byteArrayInputStream, true, null);
    return file;
  }
 
  public void deleteModule(final IErlModule module) throws CoreException {
    module.dispose();
View Full Code Here

        if (!file.exists()) {
          IFolder folder = getProject().getFolder(".settings");
          if (!folder.exists()) {
            folder.create(true, true, null);
          }
          file.create(new ByteArrayInputStream(runtime.getBytes()), true, null);
        } else {
          file.setContents(new ByteArrayInputStream(runtime.getBytes()), true, false, null);
        }
      } else {
        if (file.exists()) {
View Full Code Here

      if (!folder.exists()) {
        folder.create(true, true, new NullProgressMonitor());
      }
      IFile file = folder.getFile("console.snippet");
      if (!file.exists()) {
        file.create(new ByteArrayInputStream(("import com.google.appengine.api.datastore.*;\r\n" +
            "import com.google.appengine.api.images.*;\r\n" +
            "import com.google.appengine.api.xmpp.*;\r\n" +
            "import com.google.appengine.api.mail.*;\r\n" +
            "import com.google.appengine.api.urlfetch.*;\r\n" +
            "import com.google.appengine.api.memcache.*;\r\n" +
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.