• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Read the contents of a folder

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

Here's my problem. I'm trying to read the contents of a folder on the server where my applet is stored, and add all filenames to a combo box. I've been able to read individual files for settings and such using code like:


But I'm wondering if it's possible to read a folder this way, somehow get a list of the contents, and play with that instead. If not, I might have to make a file listing the contents of the folder, but ideally, I want files to be uploaded at any time and have the applet just pick up on it, without having to edit files or anything.

Any suggestions? Thanks!
[ May 27, 2004: Message edited by: Tom Hazelton ]
 
Bartender
Posts: 9612
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can list the contents of a directory using java.io.File. Of course, you can't use a File object across a network connection so you will probably need to create a servlet to use the File and return the results.
 
I guess everyone has an angle. Fine, what do you want? Just know that you cannot have this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic