Use File class to get the list of files from the directory. Iterate through the files to form a string (of file names) that you want to pass back to the client.
Try something on these lines-
final File folder = new File("docs");
final File[] files = folder.listFiles();
final StringBuilder filenames = new StringBuilder();
for(File file : files) {
filenames.append(file.getName());
// append separator if required
}