* Replies to the requester with the File Tree rooted at the path requested by the requester.
*/
class FileTreeGetter implements Handler<Message<JsonObject>> {
@Override
public void handle(Message<JsonObject> message) {
GetDirectoryImpl request = GetDirectoryImpl.fromJsonString(Dto.get(message));
final GetDirectoryResponseImpl response = GetDirectoryResponseImpl.make();
synchronized (FileTree.this.lock) {
response.setRootId(Long.toString(currentTreeVersion));
PathUtils.walk(request.getPath(), "/", new PathVisitor() {
@Override
public void visit(String path, String name) {
// Special case root.
if ("/".equals(path)) {
response.setBaseDirectory(root);