// if found broken link return whatever you have in list
// first item in a list is always passed path param
LinkedList ls = new LinkedList();
if(path == null) {
ls.add(new FileName("/"));
return ls;
}
//ls.add(path);
Object node = null;
String name = path.toString();
for(int i=0; i<256; i++) {
try {
node = fsroot.lookup(name);
} catch(NameNotFoundException ex) {
node = null;
}
if(node instanceof FNode) {
ls.add(new FileName(name));
FNode fnode = (FNode) node;
if(fnode.getType() == FNode.LINK) {
name = fnode.getLinkRef();
} else {
return ls;
}
} else {
ls.add(new FileName(name));
return ls;
}
}
throw new VFSException("Link resolution infinitely looped: " + name);