}
return minLength;
}
public Path apply(Path relativePath) {
FastStack absoluteStack = new FastStack(16);
for (int i = 0; i < chunks.length; i++) {
absoluteStack.push(chunks[i]);
}
for (int i = 0; i < relativePath.chunks.length; i++) {
String relativeChunk = relativePath.chunks[i];
if (relativeChunk.equals("..")) {
absoluteStack.pop();
} else if (!relativeChunk.equals(".")) {
absoluteStack.push(relativeChunk);
}
}
String[] result = new String[absoluteStack.size()];
for (int i = 0; i < result.length; i++) {
result[i] = (String) absoluteStack.get(i);
}
return new Path(result);
}