http://www.thehost.com/someSection/someSubSection/Presentation.doc for example. It could be a pdf, or ppt etc.
I want to display the size and the type of file. Is there a way to load a file from the URL and then get it's size and type. The type I could always get by parsing the url, but it's not too elegant.
If not, well that's more difficult as you'll need to cooperation of whatever web app the files belong to.
this is actually an html type.
try doHeader() to get the content type and file size if the web container does support it (I haven't done it)
Receives an HTTP HEAD request from the protected service method and handles the request. The client sends a HEAD request when it wants to see only the headers of a response, such as Content-Type or Content-Length. The HTTP HEAD method counts the output bytes in the response to set the Content-Length header accurately.
Otherwise, use URLConnnetion to the page and inspect the response header.
For instance, conecting to this page http://wiki.apache.org/nutch-data/attachments/Presentations/attachments/serverside1.pdf , you could see
Size: 124.57 KB (127,562 bytes)
[ March 05, 2007: Message edited by: vu lee ]