Author
Is it possible to access HTTP protocol folders as Java objects
Prince PV
Greenhorn
Joined: Jan 29, 2009
Posts: 5
posted Jan 21, 2010 06:05:53
0
Is it possible to retrieve the folders in an http server as java.io.File objects?
For instance, Consider the http site http://java.sun.com/ , The http url of a file on this server is http://java.sun.com/new2java/educators/index.jsp . Is it possible to rerieve the folders new2java and educators as java.io.File objects?
Any tips on this is very much appreciated.
Prince
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
posted Jan 21, 2010 13:36:14
0
No. 1) File is for local (and Windows share) files only. 2) In URLs there is no notion of "folders". What you see as a folder may not even exist physically; web containers (like Apache HTTPD or Tomcat ) allow you to map any URL to any file.
And I really urge you to read your private messages and follow the instructions therein. This is your last warning.
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Andrew Monkhouse
author and jackaroo
Marshal Commander
Joined: Mar 28, 2003
Posts: 10826
posted Jan 21, 2010 20:33:27
0
Rob Prime wrote: This is your last warning.
Overruled. He blatantly ignored 3 previous warnings. His account is now locked. As is this topic.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon , PDF from Apress , Online reference: Books 24x7 Personal blog
subject: Is it possible to access HTTP protocol folders as Java objects