* are relative to the given directory.
*
* @param directory
*/
public String[] list(String directory) throws IOException {
final FSEntry entry = getEntry(directory);
if (entry == null) {
throw new FileNotFoundException(directory);
}
if (!entry.isDirectory()) {
throw new IOException("Cannot list on non-directories " + directory);
}
final ArrayList<String> list = new ArrayList<String>();
final StringBuilder entryPath = new StringBuilder(directory).append(File.separatorChar);
final int directoryPathSize = entryPath.length();
for (Iterator<? extends FSEntry> i = entry.getDirectory().iterator(); i.hasNext();) {
final FSEntry child = i.next();
final String name = child.getName();
// never include the parent directory and the current directory in
// the result if they exist by any chance.
if (".".equals(name) || "..".equals(name)) {
continue;