Package org.eclipse.core.filesystem

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


      outputStream.write("<!doctype html>".getBytes());
      outputStream.close();
    } catch (IOException e) {
      fail("Count not create a test file in the Orion Project:" + e.getLocalizedMessage());
    }
    assertTrue("the file in the project folder should exist.", file.fetchInfo().exists());

    // move the project by renaming the project by changing the projectName
    String movedProjectName = "Moved Orion Project";
    projectInfo.setFullName(movedProjectName);
View Full Code Here


    // linked folder hasn't moved
    projectFolder = readProjectInfo.getProjectStore();
    assertTrue("the linked project folder should stay the same", projectFolder.equals(linkedFolder));
    assertTrue("the linked project folder should exist.", projectFolder.fetchInfo().exists());
    file = projectFolder.getChild(fileName);
    assertTrue("the file in the linked project folder should exist.", file.fetchInfo().exists());

    // delete the project contents
    file.delete(EFS.NONE, null);
    assertFalse("the file in the project folder should not exist.", file.fetchInfo().exists());
    // delete the linked project
View Full Code Here

    file = projectFolder.getChild(fileName);
    assertTrue("the file in the linked project folder should exist.", file.fetchInfo().exists());

    // delete the project contents
    file.delete(EFS.NONE, null);
    assertFalse("the file in the project folder should not exist.", file.fetchInfo().exists());
    // delete the linked project
    projectFolder.delete(EFS.NONE, null);
    assertFalse("the linked project should not exist.", projectFolder.fetchInfo().exists());
  }
View Full Code Here

    projectInfo.setWorkspaceId(workspaceInfo.getUniqueId());
    metaStore.createProject(projectInfo);

    // create a project directory and file
    IFileStore projectFolder = metaStore.getDefaultContentLocation(projectInfo);
    if (!projectFolder.fetchInfo().exists()) {
      projectFolder.mkdir(EFS.NONE, null);
    }
    assertTrue(projectFolder.fetchInfo().exists());
    assertTrue(projectFolder.fetchInfo().isDirectory());
    String fileName = "file.html";
View Full Code Here

    // create a project directory and file
    IFileStore projectFolder = metaStore.getDefaultContentLocation(projectInfo);
    if (!projectFolder.fetchInfo().exists()) {
      projectFolder.mkdir(EFS.NONE, null);
    }
    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);
View Full Code Here

    IFileStore projectFolder = metaStore.getDefaultContentLocation(projectInfo);
    if (!projectFolder.fetchInfo().exists()) {
      projectFolder.mkdir(EFS.NONE, null);
    }
    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());
View Full Code Here

      outputStream.write("<!doctype html>".getBytes());
      outputStream.close();
    } catch (IOException e) {
      fail("Count not create a test file in the Orion Project:" + e.getLocalizedMessage());
    }
    assertTrue("the file in the project folder should exist.", file.fetchInfo().exists());

    // update the project with the content location
    projectInfo.setContentLocation(projectFolder.toLocalFile(EFS.NONE, null).toURI());
    metaStore.updateProject(projectInfo);
View Full Code Here

    JSONObject responseObject = new JSONObject(response.getText());
    assertNotNull("No directory information in response", responseObject);

    IFileStore workspaceStore = OrionConfiguration.getMetaStore().getWorkspaceContentLocation(workspaceId);
    IFileStore localFolder = workspaceStore.getChild(newDirectoryName);
    assertTrue("Create directory response was OK, but the directory does not exist", localFolder.fetchInfo().exists() && localFolder.fetchInfo().isDirectory());
    checkDirectoryMetadata(responseObject, newDirectoryName, null, null, null, null, null);

    //should be able to perform GET on location header to obtain metadata
    String location = response.getHeaderField(ProtocolConstants.HEADER_LOCATION);
    request = getGetRequest(location);
View Full Code Here

    JSONObject responseObject = new JSONObject(response.getText());
    assertNotNull("No directory information in response", responseObject);

    IFileStore workspaceStore = OrionConfiguration.getMetaStore().getWorkspaceContentLocation(workspaceId);
    IFileStore localFolder = workspaceStore.getChild(newDirectoryName);
    assertTrue("Create directory response was OK, but the directory does not exist", localFolder.fetchInfo().exists() && localFolder.fetchInfo().isDirectory());
    checkDirectoryMetadata(responseObject, newDirectoryName, null, null, null, null, null);

    //should be able to perform GET on location header to obtain metadata
    String location = response.getHeaderField(ProtocolConstants.HEADER_LOCATION);
    request = getGetRequest(location);
View Full Code Here

      OrionConfiguration.getMetaStore().createProject(projectInfo);

      IFileStore projectFolder = OrionConfiguration.getMetaStore().getDefaultContentLocation(projectInfo);
      projectInfo.setContentLocation(projectFolder.toURI());
      OrionConfiguration.getMetaStore().updateProject(projectInfo);
      if (!projectFolder.fetchInfo().exists()) {
        projectFolder.mkdir(EFS.NONE, null);
      }
      assertTrue(projectFolder.fetchInfo().exists() && projectFolder.fetchInfo().isDirectory());
      String fileName = "file.html";
      IFileStore file = projectFolder.getChild(fileName);
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.