Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 14th, 2003, 05:50 AM
Registered User
 
Join Date: Nov 2003
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
 
Old December 14th, 2003, 01:45 PM
Friend of Wrox
 
Join Date: Jun 2003
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





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.