public String nameList(String dir) throws IOException {
  passive();
  send("NLST " + dir);
  readCode(150);
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  IOUtils.copyAndClose(inData,out);
  readCode(226);
  byte[] data=out.toByteArray();
  return new String(data);
}

public String nameList ( String dir ) throws IOException { passive ( ) ; send ( "NLST " + dir ) ; readCode ( 150 ) ; ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; IOUtils . copyAndClose ( inData , out ) ; readCode ( 226 ) ; byte [ ] data = out . toByteArray ( ) ; return new String ( data ) ; }
get the directory listing ( nlst ) .
