##### HELP: Getting List of file on a Web Server ######

Discussion in 'Java' started by CalAmity!, Jan 18, 2006.

  1. CalAmity!

    CalAmity! Guest

    Hi,
    I need to get the list of files in a particular folder on a web server.
    Assuming that I have the read access to the server, how do I do this??

    Example: I need to find out all the files at
    http://www.example.org/folderA/folderB/

    Does anyone know the code in JAVA??
    - Amit
     
    CalAmity!, Jan 18, 2006
    #1
    1. Advertising

  2. "CalAmity!" <> schrieb im Newsbeitrag
    news:...
    > Hi,
    > I need to get the list of files in a particular folder on a web server.
    > Assuming that I have the read access to the server, how do I do this??
    >
    > Example: I need to find out all the files at
    > http://www.example.org/folderA/folderB/
    >
    > Does anyone know the code in JAVA??
    > - Amit


    new java.io.File(getServletContext().getRealPath("/folderB")).list()

    This requires that the code runs in the web application server for context
    folderA, but you did not mention it must not....

    Hiran Chaudhuri
     
    Hiran Chaudhuri, Jan 20, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGVyZG8=?=
    Replies:
    0
    Views:
    601
    =?Utf-8?B?UGVyZG8=?=
    Feb 6, 2004
  2. -
    Replies:
    2
    Views:
    447
    Alan Krueger
    Jul 29, 2005
  3. gnusmsa
    Replies:
    1
    Views:
    970
    r2thej151
    Aug 19, 2006
  4. Replies:
    3
    Views:
    415
  5. pbd22
    Replies:
    1
    Views:
    188
Loading...

Share This Page