* Adds the revision to the modification set.
*
* @param revision
*/
private void addRevision(File revision, String status) {
User user = revision.getServer().getUser(revision.getModifiedBy());
if ((user != null) && (user.getName().equals("BuildMaster"))) {
return;
}
Modification mod = new Modification();
mod.type = "StarTeam";
String fileName = revision.getName();
String folderName = revision.getParentFolder().getFolderHierarchy();
Modification.ModifiedFile modFile = mod.createModifiedFile(fileName, folderName);
modFile.action = status;
mod.modifiedTime = revision.getModifiedTime().createDate();
mod.userName = user.getName();
mod.comment = revision.getComment();
// Only get emails for users still on the system
if (user != null && canLookupEmails) {
// Try to obtain email to add. This is only allowed if logged on
// user is SERVER ADMINISTRATOR
try {
// check if user account exists
UserAccount useracct =
user.getServer().getAdministration().findUserAccount(user.getID());
if (useracct == null) {
LOG.warn("User account " + user.getID() + " not found for email address.");
} else {
mod.emailAddress = useracct.getEmailAddress();
}
} catch (ServerException sx) {
// Logged on user does not have permission to get user's email.