Package org.eclipse.core.resources

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


    try {
      if (preferenceFile.exists()) {
        preferenceFile.setContents(new ByteArrayInputStream(preferenceBytes.toByteArray()), true,
                false, null);
      } else {
        preferenceFile.create(new ByteArrayInputStream(preferenceBytes.toByteArray()), true, null);
      }
    } catch (CoreException e) {
      // might fail if writing is not possible
      // for some reason
      CasEditorPlugin.log(e);
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

        // provide opportunity to checkout read-only .classpath file (23984)
        ResourcesPlugin.getWorkspace().validateEdit(new IFile[]{rscFile}, null);
      }
      rscFile.setContents(inputStream, IResource.FORCE, null);
    } else {
      rscFile.create(inputStream, IResource.FORCE, null);
    }
  }

  /**
   * If a cycle is detected, then cycleParticipants contains all the paths of projects involved in this cycle (directly and indirectly),
View Full Code Here

     
      if (destinationFile.exists()) {
        destinationFile.setContents(
          processedInputStream, true, true, progressMonitor);
      } else {
        destinationFile.create(
          processedInputStream, true, progressMonitor);
      }
     
      processedInputStream.close();
View Full Code Here

      final TSubSt subst = TGlobal.sub(this.global);
      final URLClassLoader loader = TSubSt.loader(subst);
      stream = loader.getResourceAsStream(fr);
      if (stream == null) return null;        // not here :-(
      newsrc.create(stream, IResource.FORCE | IResource.DERIVED, new NullProgressMonitor());
    } catch (CoreException e) {
      System.err.println(e.getMessage());
      return null;
    } finally {
      try { if (stream != null) stream.close(); } catch (IOException ioe) {}
View Full Code Here

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

      String fileName = "org/jbpm/eclipse/wizard/project/" + exampleType + ".bpmn.template";
        IFolder folder = project.getProject().getFolder("src/main/resources");
        IFile file = folder.getFile("sample.bpmn");
        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

                              "</form>\n" +
                              "</body>\n" +
                              "</html>";
                            IFile file = folder.getFile(fileName);
                            if (!file.exists()) {
                                  file.create(new ByteArrayInputStream(output.getBytes()), true, monitor);
                              } else {
                                  file.setContents(new ByteArrayInputStream(output.getBytes()), true, false, monitor);
                              }
                          }
                          String fileName = process.getId() + ".ftl";
View Full Code Here

                            "</form>\n" +
                            "</body>\n" +
                            "</html>";
                          IFile file = folder.getFile(fileName);
                          if (!file.exists()) {
                                file.create(new ByteArrayInputStream(output.getBytes()), true, monitor);
                            } else {
                                file.setContents(new ByteArrayInputStream(output.getBytes()), true, false, monitor);
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
View Full Code Here

          if (!metaInf.exists()) {
            createFolder(metaInf, null);
          }
          IFile workDefinitionsConfig = metaInf.getFile("drools.rulebase.conf");
          if (addToConfigFile.getSelection() && !workDefinitionsConfig.exists()) {
            workDefinitionsConfig.create(new ByteArrayInputStream("".getBytes()), true, null);
          }
        Iterator<Object> iterator =
          ((StructuredSelection) treeViewer.getSelection()).iterator();
        Map<String, WorkDefinitionImpl> workDefs = new HashMap<String, WorkDefinitionImpl>();
          while (iterator.hasNext()) {
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.