Instead of all of these HashMap operations, why not:

  for (int i = 0; i < entries.length) {
    if (new File(dir, entries[i])).isDirectory())
      entries[i] += "/";
  }
  Arrays.sort(entries);

Its fewer object allocations. We don't have the hash operations. We can still use the natural comparator for Arrays.sort().

And below in the scanTree routine, we already need name + "/" for a directory anyway. And we can decide to enter scanTree or scanOne using the suffix:

  for (String name : entries) {
    if (name.charAt(name.length() - 1) == '/')
      scanTree(prefix + name, new File(dir, name);
    else
      scanOne(prefix + name);
  }