예제 #1
0
  @Override
  public IFileStore getStore(URI uri) {
    CDOURIData data = new CDOURIData(uri.toString());
    // String authority = uri.getAuthority();
    // IPath path = new Path(uri.getPath());
    // String repositoryName = path.segment(0);
    // path = path.removeFirstSegments(1);
    //
    // IPath branchPath = Path.EMPTY;
    // long timeStamp = CDOBranchPoint.UNSPECIFIED_DATE;
    //
    // while (path.segmentCount() != 0)
    // {
    // String segment = path.segment(0);
    // path = path.removeFirstSegments(1);
    //
    // if (segment.startsWith("@"))
    // {
    // if (segment.length() != 1)
    // {
    // if (!segment.equals("@HEAD"))
    // {
    // timeStamp = Long.parseLong(segment.substring(1));
    // }
    // }
    //
    // break;
    // }
    //
    // branchPath = branchPath.append(segment);
    // }
    //
    // int segments = branchPath.segmentCount();
    // if (segments == 0 || segments == 1 &&
    // !branchPath.segment(0).equals(CDOBranch.MAIN_BRANCH_NAME))
    // {
    // branchPath = new Path(CDOBranch.MAIN_BRANCH_NAME).append(branchPath);
    // }

    String authority = data.getAuthority();
    String repositoryName = data.getRepositoryName();
    IPath path = data.getResourcePath();
    IPath branchPath = data.getBranchPath();
    long timeStamp = data.getTimeStamp();
    CDOFileRoot root = new CDOFileRoot(this, authority, repositoryName, branchPath, timeStamp);
    if (path.isEmpty()) {
      return root;
    }

    return root.getFileStore(path);
  }
예제 #2
0
  protected CDOView openView(CDOFileRoot root, IProgressMonitor monitor) {
    String authority = root.getAuthority();
    String repositoryName = root.getRepositoryName();
    String branchPath = root.getBranchPath().toPortableString();
    final long timeStamp = root.getTimeStamp();

    final CDOSession session = getSession(authority, repositoryName, monitor);
    final CDOBranch branch = session.getBranchManager().getBranch(branchPath);

    return InfiniteProgress.call(
        "Open view",
        new Callable<CDOView>() {
          public CDOView call() throws Exception {
            return session.openView(branch, timeStamp);
          }
        });
  }
예제 #3
0
  public CDOView getView(CDOFileRoot root, IProgressMonitor monitor) {
    URI uri = root.toURI();
    CDOView view = views.get(uri);
    if (view == null) {
      view = openView(root, monitor);
      views.put(uri, view);
    }

    return view;
  }