Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading the file list from web server  RSS feed

 
Yogesh Bompilwar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to list down and use names of files from a directory
in a servlet. The target directory is on the server itself.
Please can anyone help me out in accessing and reading the file list inside directory/folder.

Thanking you in anticipation
Yogesh
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By convention, requesting a directory name returns a file named index.html containing a directory listing. This feature is usually overridden by placing an index.html file in that directory containing useful information or turned off in the web server to prevent unscrupulous users from gaining information about your directory structure.
As a last resort, you could write a servlet that returns the list of files you require. If you're crafty, you could return a serialized List object so you wouldn't even have to parse it on the client end.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!