// For all Files in this folder, we need to check
// if there have been modifications.
Item[] files = starteamFolder.getItems("File");
for (int i = 0; i < files.length; i++) {
File eachFile = (File) files[i];
String filename = eachFile.getName();
java.io.File localFile =
new java.io.File(targetFolder, filename);
delistLocalFile(localFiles, localFile);
// If the file doesn't pass the include/exclude tests, skip it.
if (!shouldProcess(filename)) {
log("Skipping " + eachFile.toString(), Project.MSG_INFO);
continue;
}
// If forced is not set then we may save ourselves some work by
// looking at the status flag.
// Otherwise, we care nothing about these statuses.
if (!isForced()) {
int fileStatus = (eachFile.getStatus());
// We try to update the status once to give StarTeam
// another chance.
if (fileStatus == Status.MERGE || fileStatus == Status.UNKNOWN) {
eachFile.updateStatus(true, true);
fileStatus = (eachFile.getStatus());
}
if (fileStatus == Status.CURRENT) {
log("Not processing " + eachFile.toString()
+ " as it is current.",
Project.MSG_INFO);
continue;
}
}
// Check out anything else.
// Just a note: StarTeam has a status for NEW which implies
// that there is an item on your local machine that is not
// in the repository. These are the items that show up as
// NOT IN VIEW in the Starteam GUI.
// One would think that we would want to perhaps checkin the
// NEW items (not in all cases! - Steve Cohen 15 Dec 2001)
// Unfortunately, the sdk doesn't really work, and we can't
// actually see anything with a status of NEW. That is why
// we can just check out everything here without worrying
// about losing anything.
log("Checking Out: " + (localFile.toString()), Project.MSG_INFO);
eachFile.checkoutTo(localFile, this.lockStatus,
true, true, true);
}
// Now we recursively call this method on all sub folders in this
// folder unless recursive attribute is off.