} else if (nextByte == (byte)'/') {
fileStart = index + 1;
}
}
RelativeDirectory directory = null;
if (fileStart == dirStart)
directory = getRelativeDirectory("");
else if (lastDir != null && lastLen == fileStart - dirStart - 1) {
int index = lastLen - 1;
while (zipDir[lastStart + index] == zipDir[dirStart + index]) {
if (index == 0) {
directory = lastDir;
break;
}
index--;
}
}
// Sub directories
if (directory == null) {
lastStart = dirStart;
lastLen = fileStart - dirStart - 1;
directory = getRelativeDirectory(new String(zipDir, dirStart, lastLen, "UTF-8"));
lastDir = directory;
// Enter also all the parent directories
RelativeDirectory tempDirectory = directory;
while (directories.get(tempDirectory) == null) {
directories.put(tempDirectory, new DirectoryEntry(tempDirectory, zipFileIndex));
if (tempDirectory.path.indexOf("/") == tempDirectory.path.length() - 1)
break;
else {
// use shared RelativeDirectory objects for parent dirs
tempDirectory = getRelativeDirectory(tempDirectory.dirname().getPath());
}
}
}
else {
if (directories.get(directory) == null) {