示例#1
0
  /**
   * Hide our private parts from the navigators other browsers.
   *
   * @throws CoreException
   */
  public void markTeamPrivateResources() throws CoreException {
    for (final Object rmObj : mappings) {
      final RepositoryMapping rm = (RepositoryMapping) rmObj;
      final IContainer c = rm.getContainer();
      if (c == null) continue; // Not fully mapped yet?

      final IResource dotGit = c.findMember(Constants.DOT_GIT);
      if (dotGit != null) {
        try {
          final Repository r = rm.getRepository();
          final File dotGitDir = dotGit.getLocation().toFile().getCanonicalFile();
          if (dotGitDir.equals(r.getDirectory())) {
            trace("teamPrivate " + dotGit); // $NON-NLS-1$
            dotGit.setTeamPrivateMember(true);
          }
        } catch (IOException err) {
          throw new CoreException(Activator.error(CoreText.Error_CanonicalFile, err));
        }
      }
    }
  }