/// <summary> /// Does the work of opening the supplied Starteam view and calling /// the <see cref="visit"/> method setting the pattern in motion to perform the task. /// </summary> protected override void ExecuteTask() { _filesAffected = 0; testPreconditions(); InterOpStarTeam.StView snapshot = openView(); try { InterOpStarTeam.StStarTeamFinderStatics starTeamFinder = new InterOpStarTeam.StStarTeamFinderStatics(); InterOpStarTeam.StFolder starTeamRootFolder = starTeamFinder.findFolder(snapshot.RootFolder, _rootStarTeamFolder); // set the local folder. FileInfo localrootfolder; if (null == starTeamRootFolder) { throw new BuildException("Unable to find root folder in repository.", Location); } if (null == _rootLocalFolder) { // use Star Team's default try { localrootfolder = new FileInfo(starTeamRootFolder.Path); } catch (Exception e) { throw new BuildException(string.Format("Could not get handle to root folder ({0}) found.", starTeamRootFolder.Path), Location, e); } } else { // force StarTeam to use our folder try { Log(Level.Info, "Overriding local folder to '{0}'", _rootLocalFolder); localrootfolder = new FileInfo(_rootLocalFolder); } catch (Exception e) { throw new BuildException(string.Format("Could not get handle to root folder '{0}'.", starTeamRootFolder.Path), Location, e); } } // Inspect everything in the root folder and then recursively visit(starTeamRootFolder, localrootfolder); Log(Level.Info, "{0} files affected", _filesAffected.ToString()); } catch (System.Exception e) { throw new BuildException(e.Message, Location, e); } }
/// <summary> /// Does the work of opening the supplied Starteam view and calling /// the <see cref="visit"/> method setting the pattern in motion to perform the task. /// </summary> protected override void ExecuteTask() { _filesAffected = 0; testPreconditions(); InterOpStarTeam.StView snapshot = openView(); try { InterOpStarTeam.StStarTeamFinderStatics starTeamFinder = new InterOpStarTeam.StStarTeamFinderStatics(); InterOpStarTeam.StFolder starTeamRootFolder = starTeamFinder.findFolder(snapshot.RootFolder, _rootStarTeamFolder); // set the local folder. FileInfo localrootfolder; if (null == starTeamRootFolder) { throw new BuildException("Unable to find root folder in repository.",Location); } if (null == _rootLocalFolder) { // use Star Team's default try { localrootfolder = new FileInfo(starTeamRootFolder.Path); } catch(Exception e) { throw new BuildException(string.Format("Could not get handle to root folder ({0}) found.",starTeamRootFolder.Path),Location,e); } } else { // force StarTeam to use our folder try { Log(Level.Info, "Overriding local folder to '{0}'", _rootLocalFolder); localrootfolder = new FileInfo(_rootLocalFolder); } catch(Exception e) { throw new BuildException(string.Format("Could not get handle to root folder '{0}'.", starTeamRootFolder.Path), Location, e); } } // Inspect everything in the root folder and then recursively visit(starTeamRootFolder, localrootfolder); Log(Level.Info, "{0} files affected", _filesAffected.ToString()); } catch (System.Exception e) { throw new BuildException(e.Message, Location, e); } }