public ClearCaseConnection()

in clearcase-server/src/jetbrains/buildServer/buildTriggers/vcs/clearcase/ClearCaseConnection.java [103:149]


  public ClearCaseConnection(final ViewPath viewPath, /*boolean ucmSupported, */
                             @NotNull final ClearCaseInteractiveProcess process,
                             final ClearCaseStructureCache cache,
                             final VcsRoot root,
                             final boolean checkCSChange) throws VcsException, IOException {
    // Explanation of config specs at:
    // http://www.philforhumanity.com/ClearCase_Support_17.html

    myViewPath = viewPath;
    myProcess = process;
    myCache = cache;
    myRoot = root;

    myUCMSupported = isUCMView(root);//ucmSupported;

    if (!isClearCaseView(myViewPath.getClearCaseViewPath(), myProcess)) {
      throw new VcsException("Invalid ClearCase view: \"" + myViewPath.getClearCaseViewPath() + "\"");
    }

    final File cacheDir = myCache == null ? null : myCache.getCacheDir(root, true);

    final File configSpecFile = cacheDir != null ? new File(cacheDir, "cs") : null;

    ConfigSpec oldConfigSpec = null;
    if (checkCSChange && configSpecFile != null && configSpecFile.isFile()) {
      oldConfigSpec = ConfigSpecParseUtil.getConfigSpecFromStream(myViewPath.getClearCaseViewPathFile(), new FileInputStream(configSpecFile), configSpecFile);
    }

    myConfigSpec = checkCSChange && configSpecFile != null
                   ? ConfigSpecParseUtil.getAndSaveConfigSpec(myViewPath, configSpecFile, myProcess)
                   : ConfigSpecParseUtil.getConfigSpec(myViewPath, myProcess);

    myConfigSpec.setViewIsDynamic(isViewIsDynamic());

    myConfigSpecWasChanged = checkCSChange && configSpecFile != null && !myConfigSpec.equals(oldConfigSpec);

    if (myConfigSpecWasChanged) {
      myCache.clearCaches(root);
    }

    if (!myConfigSpec.isUnderLoadRules(getClearCaseViewPath(), myViewPath.getWholePath())) {
      throw new VcsException("The path \"" + myViewPath.getWholePath() + "\" is not loaded by ClearCase view \"" + myViewPath.getClearCaseViewPath() + "\" according to its config spec.");
    }

    //??
    updateCurrentView();
  }