Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 14th, 2003, 05:50 AM
Registered User
 
Join Date: Nov 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drives and Directories

Hi,

How do you program a servlet to scan through all the drives and directories of a server to search for a particular file? In other words, I would like to use a servlet to display a list of available drives (C:\, D:\, etc.) in the form of <a href> reference links. Upon clicking a link of a particular drive, it would show the available directories/folders in that drive. Again, upon clicking the link to a particular folder, it would show the available files in that folder.


Pls help!!! Thanks in advance! : )
Zen
Reply With Quote
  #2 (permalink)  
Old December 14th, 2003, 01:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use java.io.File.list(), which returns an array of all files in a directory, then iterate through the array using java.io.File.isDirectory() to determine if the element is a directory or ot. Have at the JavaDoc for more detailed information.

Cheers

Martyn
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Server Drives and network folders... wenzation VBScript 11 November 24th, 2006 03:53 AM
FSO - Network Drives - Please help! sparkyUK Classic ASP Basics 8 August 23rd, 2004 09:26 AM
Create list of logical drives in combobox bcmaverik VB.NET 2002/2003 Basics 1 February 7th, 2004 02:31 PM
Create list of logical drives in combobox bcmaverik Beginning VB 6 3 January 30th, 2004 02:47 PM



All times are GMT -4. The time now is 04:41 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.