Package org.eclipse.core.filesystem

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


      root = EFS.getStore(platformLocationURI);
    } catch (CoreException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    String rootURI = root.toURI().toString();
   
    return fileURI.substring(rootURI.length());
  }
}
View Full Code Here


    String userId = workspace.getUserId();
    assertNotNull(userId);
    IFileStore fsStore = getProjectStore(wp, userId);
    fsStore = fsStore.getFileStore(path.removeFirstSegments(3));

    File file = new File(fsStore.toURI());
    if (RepositoryCache.FileKey.isGitRepository(file, FS.DETECTED)) {
      // 'file' is already what we're looking for
    } else if (RepositoryCache.FileKey.isGitRepository(new File(file, Constants.DOT_GIT), FS.DETECTED)) {
      file = new File(file, Constants.DOT_GIT);
    } else {
View Full Code Here

      throw new RuntimeException("Unable to compute base file system location"); //$NON-NLS-1$

    IFileStore rootStore = EFS.getLocalFileSystem().getStore(location);
    try {
      rootStore.mkdir(EFS.NONE, null);
      rootStoreURI = rootStore.toURI();
    } catch (CoreException e) {
      throw new RuntimeException("Instance location is read only: " + rootStore, e); //$NON-NLS-1$
    }
  }
View Full Code Here

    if (projectStore.fetchInfo().exists()) {
      //This folder must be empty initially or we risk showing another user's old private data
      projectStore.delete(EFS.NONE, null);
    }
    projectStore.mkdir(EFS.NONE, null);
    return projectStore.toURI();
  }

  /**
   * Returns the project for the given project metadata location. The expected format of the
   * location is a URI whose path is of the form /workspace/workspaceId/project/projectName.
View Full Code Here

    // remove the project folder
    URI contentURI = project.getContentLocation();

    // only delete project contents if they are in default location
    IFileStore projectStore = OrionConfiguration.getMetaStore().getDefaultContentLocation(project);
    URI defaultLocation = projectStore.toURI();
    if (URIUtil.sameURI(defaultLocation, contentURI)) {
      projectStore.delete(EFS.NONE, null);
    }

    OrionConfiguration.getMetaStore().deleteProject(workspace.getUniqueId(), project.getFullName());
View Full Code Here

      ProjectInfo projectInfo = OrionConfiguration.getMetaStore().readProject(workspaceId, projectName);
      if (projectInfo == null) {
        return null;
      }
      IFileStore projectStore = OrionConfiguration.getMetaStore().getDefaultContentLocation(projectInfo);
      String encodedProjectRoot = projectStore.toURI().toString() + "/";
      String projectRoot = URLDecoder.decode(encodedProjectRoot, "UTF-8");
      String absolutePath = new Path(projectRoot).append(path).toString();
      return absolutePath;
    } catch (CoreException e) {
      fail(e.getLocalizedMessage());
View Full Code Here

    }
  }

  protected static void initializeWorkspaceLocation() {
    IFileStore root = OrionConfiguration.getRootLocation();
    FILESTORE_PREFIX = root.toURI().toString() + "/";
  }

  protected void remove(String path) throws CoreException {
    String absolutePath = getAbsolutePath(path);
    if (absolutePath != null) {
View Full Code Here

    ProjectInfo projectInfo1 = new ProjectInfo();
    projectInfo1.setFullName(projectName);
    projectInfo1.setWorkspaceId(workspaceInfo.getUniqueId());
    IFileStore projectFolder = metaStore.getDefaultContentLocation(projectInfo1);
    assertFalse(projectFolder.fetchInfo().exists());
    projectInfo1.setContentLocation(projectFolder.toURI());
    metaStore.createProject(projectInfo1);
    assertTrue(projectFolder.fetchInfo().exists());

    // read the workspace
    WorkspaceInfo readWorkspaceInfo = metaStore.readWorkspace(workspaceInfo.getUniqueId());
View Full Code Here

    // create the first again project
    ProjectInfo projectInfo2 = new ProjectInfo();
    projectInfo2.setFullName(projectName);
    projectInfo2.setWorkspaceId(workspaceInfo.getUniqueId());
    IFileStore projectFolder2 = metaStore.getDefaultContentLocation(projectInfo2);
    projectInfo2.setContentLocation(projectFolder2.toURI());
    try {
      metaStore.createProject(projectInfo1);
    } catch (RuntimeException e) {
      // we expect to get a runtime exception here
      String message = e.getMessage();
View Full Code Here

    projectInfo.setWorkspaceId(workspaceInfo.getUniqueId());
    IFileStore projectFolder = metaStore.getDefaultContentLocation(projectInfo);
    assertFalse(projectFolder.fetchInfo().exists());
    projectFolder.mkdir(EFS.NONE, null);
    assertTrue(projectFolder.fetchInfo().exists() && projectFolder.fetchInfo().isDirectory());
    projectInfo.setContentLocation(projectFolder.toURI());
    metaStore.createProject(projectInfo);

    // read the project
    ProjectInfo readProjectInfo = metaStore.readProject(workspaceInfo.getUniqueId(), projectInfo.getFullName());
    assertNotNull(readProjectInfo);
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.