Package org.eclipse.core.resources

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


    try {
      stream = openHtmlContentStream();
      if (hfile.exists()) {
        hfile.setContents(stream, true, true, monitor);
      } else {
        hfile.create(stream, true, monitor);
      }
      stream.close();
    } catch (IOException e) {
      throwCoreException("Unable to create html file");
    }
View Full Code Here


      try {
        stream = openPropertiesContentStream();
        if (pfile.exists()) {
          pfile.setContents(stream, true, true, monitor);
        } else {
          pfile.create(stream, true, monitor);
        }
        stream.close();
      } catch (IOException e) {
        throwCoreException("Unable to create properties file");
      }
View Full Code Here

    try {
      stream = openHtmlContentStream();
      if (hfile.exists()) {
        hfile.setContents(stream, true, true, monitor);
      } else {
        hfile.create(stream, true, monitor);
      }
      stream.close();
    } catch (IOException e) {
      throwCoreException("Unable to create html file");
    }
View Full Code Here

      try {
        stream = openPropertiesContentStream();
        if (pfile.exists()) {
          pfile.setContents(stream, true, true, monitor);
        } else {
          pfile.create(stream, true, monitor);
        }
        stream.close();
      } catch (IOException e) {
        throwCoreException("Unable to create properties file");
      }
View Full Code Here

    IFile file = project.getFile(System.nanoTime() + ".txt");
    if (!file.exists()) {
      File tmpFile = File.createTempFile("tmp", "txt");
      FileInputStream stream = new FileInputStream(tmpFile);
      file.create(stream, false, null);
      stream.close();
    }
    return file;
  }
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

  private void createProjectFile(IJavaProject project, IProgressMonitor monitor, InputStream inputstream, String folderName, String fileName) throws CoreException {
        IFolder folder = project.getProject().getFolder(folderName);
        IFile file = folder.getFile(fileName);
        if (!file.exists()) {
            file.create(inputstream, true, monitor);
        } else {
            file.setContents(inputstream, true, false, monitor);
        }
  }
View Full Code Here

    private IFile createFile(IFolder folder,
                             String name,
                             String contents) throws CoreException {
        IFile file = folder.getFile( name );
        InputStream inputStream = new ByteArrayInputStream( contents.getBytes() );
        file.create( inputStream,
                     true,
                     NULL_MONITOR );
        return file;
    }
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

            IFolder folder = project.getProject().getFolder(folderName);
            file = folder.getFile(fileName);
        }

        if (!file.exists()) {
            file.create(inputstream, true, monitor);
        } else {
            file.setContents(inputstream, true, false, monitor);
        }
  }
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.