Article View: borland.public.jbuilder.java.api
Article #3416Still need help with searching URL directories
From: Brent Thompson
Date: Tue, 06 Jan 1998 00:00
Date: Tue, 06 Jan 1998 00:00
38 lines
1463 bytes
1463 bytes
Brent Thompson wrote:
> I'd like to take a URL and search all it's subdirectories to make a
list
> of all html docs. I'm writting an application. How can I do It? I'm
> looking for and example of source code.
Andrew Bennett wrote:
> You'll have to write some code. You can do a nice loop though. I'll
> describe:
> get current directory
> use java.io.File's getDirectory() on each node
> - if it's a directory, add it to another array or something
> - if it's a html doc, then add it to an array or something
> loop to next file
I'm still having problems. Here is an example of the code
URL myURL = new URL("http://www.xyz.com/news/"); // this is a
directory
File myFile = new File(myURL);
if(myFile.isDirectory() != false)
{
System.out.println("this is a directory!!!!!");
}
/./ etc
myFile.isDirectory doesn't work here.. I would like to open up a
directory, and get a list
of its subdirectories.
thanks
Technical Details
Message-ID:
<34B2C314.CEA6788C@agency.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,2d8e2e3c39f65a06,start X-Google-Attributes: gid1089d0,public From: Brent Thompson <brent@agency.com> Subject: Still need help with searching URL directories Date: 1998/01/06 Message-ID: <34B2C314.CEA6788C@agency.com> X-Deja-AN: 313442725 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: None Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api