if (connection.isDirectory()) form.append("------\n");
for (int i = 0; i < level; i++) form.append(" ");
form.append(connection.getPath() + connection.getName() + "\n");
if (connection.isDirectory()) {
level++;
Enumeration list = connection.list();
String path = connection.getPath() + connection.getName();
while (list.hasMoreElements()) {
Object next = list.nextElement();
String url = "file://" + path + next ;
try {
FileConnection child = (FileConnection) Connector.open(url);
getInfo(child, form);
}
catch (Exception ex) {
form.append(ex.getMessage() +"\n");
}
}
level--;
}