Article View: borland.public.jbuilder.java.api
Article #3417Re: Still need help with searching URL directories
From: Andrew Bennett
Date: Wed, 07 Jan 1998 00:00
Date: Wed, 07 Jan 1998 00:00
38 lines
1791 bytes
1791 bytes
Brent Thompson wrote:
> 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.
Oh, off of a URL. Hrm. java.io.File is probably meant for localized
file access. Although the constructor for File() takes a string, it's
probably looking for something like 'c:\autoexec.bat', '/etc/passwd',
or just 'myfile.txt'.
You might want to look into the HTTP specs and see if there are
calls you can exploit to determine such information. If it's possible,
you'll need to open a socket to the web server and ask it the
appropiate syntax, receive a stream back, parse it, and deal with
the parsed text.
Andrew
--
Andrew Bennett -> abennett@borland.com
JBuilder info -> http://www.borland.com/jbuilder/
JBuilder newsgroups info -> http://www.borland.com/newsgroups/
**** Please don't post a reply AND send email. Do one. I'll see it. ****
Technical Details
Message-ID:
<34B3B29F.A07F0108@borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34B2C314.CEA6788C@agency.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,2d8e2e3c39f65a06 X-Google-Attributes: gid1089d0,public From: Andrew Bennett <abennett@borland.com> Subject: Re: Still need help with searching URL directories Date: 1998/01/07 Message-ID: <34B3B29F.A07F0108@borland.com> X-Deja-AN: 313658985 Content-Transfer-Encoding: 7bit References: <34B2C314.CEA6788C@agency.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: None Newsgroups: borland.public.jbuilder.java.api