Applet - server folder contents


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: Applet - server folder contents

  1. #1
    Join Date
    Jul 2004
    Posts
    54

    Applet - server folder contents

    In an Applet is there anyway to get the contents of an images folder on the server - will use getImage to access selected file from folder. The files in the image folder keep changing and I have to modify code each time. If no solution, I will use a filelist.txt to do it but it would be best if code was general purpose.
    Thanks,
    RON C

  2. #2
    Join Date
    Dec 2003
    Location
    tx/us
    Posts
    131
    Probably not. The only connection an applet will be able to make back to the server would probably be through an HTTP URL. Well one way to do it might be to make sure there's no index file in the dir with the images, that the server is set to allow indexing and then you could parse the HTML of the returned auto-generated index of files. Otherwise you'd need to update a file on the server containing the image data each time images are uploaded or deleted.

  3. #3
    Join Date
    Jul 2004
    Posts
    54
    Thanks,
    RON C

  4. #4
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    If a perl script or a servet was an option, then I guess this would not be a problem,
    but I'm puzzled, how would a file listing help your applet with this ? I mean,
    if the contents keep changing all the time how will you applet "know" what file(s) in
    the list to use ? The thing is that if there is a one-size-fits-all logic in your applet
    that enables selection from this ever-changing file list (without program modifications),
    then what is the list for ?
    eschew obfuscation

  5. #5
    Join Date
    Jul 2004
    Posts
    54
    With a file list, the user can choose which image to work with. The user only selects one file but the files might change between usage.

    I've never attacked servlets yet so I'd prefer to know without that. If can't do, I'll need to study servlets or make them update html every time they change the images. That seems like an accident waiting to happen - I'll be blamed either way.

    Thanks,
    RON C

  6. #6
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    ...and its not even sure that your server hosts servlets... The easiest way may be to make a
    little perl script that will send back a delimited string of filenames to your applet.

    If you do that, they can't blame you, if you use the "updated html" solution they will
    blame you the day it is not updated, and they will be in their full rights ...
    eschew obfuscation

  7. #7
    Join Date
    Jul 2004
    Posts
    54
    Thanks.

    I offered the Perl script idea as first solution but their IT guy says it sould be self-contained. I'm going to tell them for what they paid, they can update the html - AT THEIR PERIL.

    Thanks again.
    RON C

  8. #8
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    Hah !! Serves them right.
    eschew obfuscation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center