public static String findpath(Cons dirtree, Cons path) { if ( dirtree == null ) return null; // file not found else if ( consp(first(dirtree)) ) // is this a directory? if ( ((String) first(path)) // is first(path) == .equals(first((Cons) // dir name ? first(dirtree))) ) return findpath( rest((Cons) // yes: go in first(dirtree)), // dir contents rest(path)) ; // pop path else return findpath(rest(dirtree), // no: keep path); // looking else if ( ((String) first(path)) // is first(path) == .equals(first(dirtree)) ) // file name ? return (String) first(path); // yes: success else return findpath(rest(dirtree), // no: keep path); } // looking
Contents    Page-10    Prev    Next    Page+10    Index