Package org.eclipse.core.filesystem

Examples of org.eclipse.core.filesystem.IFileStore.openOutputStream()


    }

    if (!fileInfo.exists() || confirmOverwrite(fileStore)) {
      OutputStream output= null;
      try {
        output= new BufferedOutputStream(fileStore.openOutputStream(EFS.NONE, null));
        TemplateReaderWriter writer= new TemplateReaderWriter();
        writer.save(templates, output);
      } catch (CoreException e) {
        openWriteErrorDialog();
      } catch (IOException e) {
View Full Code Here


          }
        } else if (getEditorInput() instanceof FileStoreEditorInput) {
          final URI targetURI = ((FileStoreEditorInput) getEditorInput())
              .getURI();
          final IFileStore store = EFS.getStore(targetURI);
          final OutputStream outputStream = store.openOutputStream(
              EFS.NONE, progressMonitor);
          if (null != currentMeiData) {
            MeiResourceReader.writeMEIInstance(store,
                currentMeiData, progressMonitor);
            outputStream.close();
View Full Code Here

              return read;
            }
          };
          boolean fileWritten = false;
          try {
            IOUtilities.pipe(maxBytesReadInputStream, destination.openOutputStream(EFS.NONE, null), false, true);
            fileWritten = true;
          } finally {
            if (!fileWritten) {
              try {
                destination.delete(EFS.NONE, null);
View Full Code Here

  protected static IFileStore createFile(URI uri, String fileContent) throws CoreException {
    IFileStore outputFile = EFS.getStore(uri);
    outputFile.delete(EFS.NONE, null);
    InputStream input = new ByteArrayInputStream(fileContent.getBytes());
    transferData(input, outputFile.openOutputStream(EFS.NONE, null));
    IFileInfo info = outputFile.fetchInfo();
    assertTrue("Coudn't create file " + uri, info.exists() && !info.isDirectory());

    return outputFile;
  }
View Full Code Here

    assertTrue(orgFolder.fetchInfo().exists());
    assertTrue(orgFolder.fetchInfo().isDirectory());
    String invalid = "delete.html";
    IFileStore invalidFileInOrg = orgFolder.getChild(invalid);
    try {
      OutputStream outputStream = invalidFileInOrg.openOutputStream(EFS.NONE, null);
      outputStream.write("<!doctype html>".getBytes());
      outputStream.close();
    } catch (IOException e) {
      fail("Count not create a test file in the Orion Project:" + e.getLocalizedMessage());
    }
View Full Code Here

    // create a invalid metadata file
    IFileStore rootLocation = OrionConfiguration.getRootLocation();
    String invalid = "delete.html";
    IFileStore invalidFileAtRoot = rootLocation.getChild(invalid);
    try {
      OutputStream outputStream = invalidFileAtRoot.openOutputStream(EFS.NONE, null);
      outputStream.write("<!doctype html>".getBytes());
      outputStream.close();
    } catch (IOException e) {
      fail("Count not create a test file in the Orion Project:" + e.getLocalizedMessage());
    }
View Full Code Here

    }
    assertTrue(projectFolder.fetchInfo().exists() && projectFolder.fetchInfo().isDirectory());
    String fileName = "file.html";
    IFileStore file = projectFolder.getChild(fileName);
    try {
      OutputStream outputStream = file.openOutputStream(EFS.NONE, null);
      outputStream.write("<!doctype html>".getBytes());
      outputStream.close();
    } catch (IOException e) {
      fail("Count not create a test file in the Orion Project:" + e.getLocalizedMessage());
    }
View Full Code Here

    assertTrue(projectFolder.fetchInfo().exists());
    assertTrue(projectFolder.fetchInfo().isDirectory());
    String fileName = "file.html";
    IFileStore file = projectFolder.getChild(fileName);
    try {
      OutputStream outputStream = file.openOutputStream(EFS.NONE, null);
      outputStream.write("<!doctype html>".getBytes());
      outputStream.close();
    } catch (IOException e) {
      fail("Count not create a test file in the Orion Project:" + e.getLocalizedMessage());
    }
View Full Code Here

      }
      assertTrue(projectFolder.fetchInfo().exists() && projectFolder.fetchInfo().isDirectory());
      String fileName = "file.html";
      IFileStore file = projectFolder.getChild(fileName);
      try {
        OutputStream outputStream = file.openOutputStream(EFS.NONE, null);
        outputStream.write("<!doctype html>".getBytes());
        outputStream.close();
      } catch (IOException e) {
        fail("Count not create a test file in the Orion Project:" + e.getLocalizedMessage());
      }
View Full Code Here

    String etag = response.getHeaderField(ProtocolConstants.KEY_ETAG);
    assertNotNull(etag);

    //change the file on disk
    IFileStore fileStore = EFS.getStore(makeLocalPathAbsolute(fileName));
    OutputStream out = fileStore.openOutputStream(EFS.NONE, null);
    out.write("New Contents".getBytes());
    out.close();

    //now a PUT should fail
    request = getPutFileRequest(fileName, "something");
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.