in clearcase-server/src/jetbrains/buildServer/buildTriggers/vcs/clearcase/structure/CacheProcessor.java [39:96]
public void processAllRevisions(final boolean processRoot) throws IOException, VcsException {
final Stack<ReadCacheItem> readDirs = new Stack<ReadCacheItem>();
DataInputStream input = new DataInputStream(new FileInputStream(myCacheFile));
int index = 0;
try {
while (true) {
byte type;
try {
type = input.readByte();
} catch (EOFException e) {
break;
}
if (type == CacheElement.FILE_TYPE) {
String name = TCStreamUtil.readString(input);
String version = TCStreamUtil.readString(input);
boolean text = false;
boolean executable = false;
final int modeSep = version.indexOf("|");
if (modeSep > 0) {
String mode = version.substring(modeSep);
version = version.substring(0, modeSep);
text = mode.contains("t");
executable = mode.contains("x");
}
readDirs.push(new ReadCacheItem(name, version));
myVersionProcessor.processFile(createFullPath(readDirs, myConnection), createRelPath(readDirs), createIOPath(readDirs, myConnection), version, myConnection,
text, executable);
readDirs.pop();
}
else if (type == CacheElement.DIR_OPEN_TYPE) {
String name = TCStreamUtil.readString(input);
String version = TCStreamUtil.readString(input);
readDirs.push(new ReadCacheItem(name, version));
if (index > 0 || processRoot) {
myVersionProcessor.processDirectory(createFullPath(readDirs, myConnection), createRelPath(readDirs), createIOPath(readDirs, myConnection), version, myConnection);
}
}
else if (type == CacheElement.DIR_CLOSE_TYPE){
readDirs.pop();
myVersionProcessor.finishProcessingDirectory();
}
else {
throw new IOException("Unexpected type "+ type);
}
index++;
}
} finally {
input.close();
}
}