Package org.eclipse.core.resources

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


                        IFile definitionFile = ProjectFinder.getProcessDefinitionFile(folder);
                        String processName = page.getProcessFolder().getName();
                        Document document = JpdlVersionRegistry.getContentProvider(page.getJpdlVersion()).getInitialProcessDefinitionDocument(
                                processName);
                        byte[] bytes = XmlUtil.writeXml(document);
                        definitionFile.create(new ByteArrayInputStream(bytes), true, null);
                        monitor.worked(1);
                        IFile gpdFile = folder.getFile(GpdXmlContentProvider.GPD_FILE_NAME);
                        gpdFile.create(createInitialGpdInfo(page.getNotation()), true, null);
                        monitor.worked(1);
                        ProcessCache.newProcessDefinitionWasCreated(definitionFile);
View Full Code Here


                                processName);
                        byte[] bytes = XmlUtil.writeXml(document);
                        definitionFile.create(new ByteArrayInputStream(bytes), true, null);
                        monitor.worked(1);
                        IFile gpdFile = folder.getFile(GpdXmlContentProvider.GPD_FILE_NAME);
                        gpdFile.create(createInitialGpdInfo(page.getNotation()), true, null);
                        monitor.worked(1);
                        ProcessCache.newProcessDefinitionWasCreated(definitionFile);
                        IDE.openEditor(getActivePage(), definitionFile, true);
                        monitor.worked(1);
                        BasicNewResourceWizard.selectAndReveal(gpdFile, getActiveWorkbenchWindow());
View Full Code Here

            while (entries.hasMoreElements()) {
                ZipEntry entry = entries.nextElement();
                if (!entry.getName().contains("META-INF")) {
                    IFile file = processFolder.getFile(entry.getName());
                    InputStream entryStream = zip.getInputStream(entry);
                    file.create(entryStream, true, null);
                    file.setCharset(PluginConstants.UTF_ENCODING, null);
                    entryStream.close();
                }
            }
            IFile definitionFile = ProjectFinder.getProcessDefinitionFile(processFolder);
View Full Code Here

                IFile imageFile = getImageFile();
                InputStream is = new FileInputStream(new File(path));
                if (imageFile.exists()) {
                    imageFile.setContents(is, true, false, null);
                } else {
                    imageFile.create(is, true, null);
                }
                is.close();
                return imageFile;
            } catch (Exception e) {
                DesignerLogger.logError("Unable to copy file", e);
View Full Code Here

            InputStream is = sourceFolder.getFile(fileName).getContents();
            IFile file = targetFolder.getFile(fileName);
            if (file.exists()) {
                file.delete(true, null);
            }
            file.create(is, true, null);
            file.setCharset(PluginConstants.UTF_ENCODING, null);
            return file;
        }

        @Override
View Full Code Here

          } catch (IOException e1) {
          }
      }

      stream = new ByteArrayInputStream(descriptor.getBytes());
      file.create(stream, true, monitor);
      try {
        stream.close();
      } catch (IOException e1) {
      }
    }
View Full Code Here

  public void testFileForCorpusFolder() throws CoreException {
    mProject.createProject();
    mProject.createDotCorpus();

    IFile corpusFile = mProject.getProject().getFile("corpus");
    corpusFile.create(new ByteArrayInputStream(new byte[0]), true, null);

    // check that model and project creation did not failed
    assertTrue(CasEditorPlugin.getNlpModel().findMember(mProject.getProject()) != null);
  }
View Full Code Here

  public void testFileForSourceFolder() throws CoreException {
    mProject.createProject();
    mProject.createDotCorpus();

    IFile corpusFile = mProject.getProject().getFile("UimaSourceFolder");
    corpusFile.create(new ByteArrayInputStream(new byte[0]), true, null);

    // check that model and project creation did not failed
    assertTrue(CasEditorPlugin.getNlpModel().findMember(mProject.getProject()) != null);
  }
}
View Full Code Here

      if (container.exists()) {
        IFile newFile = container.getFile(new Path(fileName));

        // If the file does not exist, create with content, mark, and return
        if (!newFile.exists()) {
          newFile.create(is, false, null);
          return newFile;
        } else {
          if (overrideContentIfExist)
            newFile.setContents(is, true, true, null);
          // return what already exisited
View Full Code Here

                "<a href=\"http://localhost:9990/ui/home\">SCA Domain</a>\n" +
                "</body>\n" +
                "</html>";
           
            IFile file = domainProject.getFile(new Path("domain.html"));
            file.create(new ByteArrayInputStream(html.getBytes()), true, new SubProgressMonitor(progressMonitor, 5));
        }
        return domainProject;
    }
}
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.