Re: io: how many imgs in 'images' folder?



maya wrote On 03/29/07 13:55,:
is it possible to determine how many files are in a given directory..

Use the list() or listFiles() methods of a File object
representing the directory.

I have this photoblog,
http://www.francesdelrio.com/photoblog/blog1/photos.jsp

not all pgs have same no. of photos, and I would like to know how to
determine how many photos are in 'images' folder for each page, to then
populate an array (or would it have to be a vector?)

list() and listFiles() return arrays. You could use
them to populate a Vector or an ArrayList or whatever else
you like, if you think it would be fun.

also I want to associate each photo w/its caption, in that case it would
have to be a hash-table? (or put everything in db?)

I'm not sure where you obtain the captions. If they're
just the file names, that's no problem: you get them when
list() or listFiles() reports the directory's contents. If
they're coming from somewhere else (JPEG comments embedded
in the photos, maybe?), you'll need to do extra work to
extract them.

Hash table? Data base? Maybe, but probably not. What
do you think they will do for you?

I have a new digital camera, I will be posting A LOT of photos from now
on, am trying to figure out what best approaches are here...

thank you...


--
Eric.Sosman@xxxxxxx
.



Relevant Pages

  • Re: io: how many imgs in images folder?
    ... Use the listor listFilesmethods of a File object ... Also note that listand listFiles() are overloaded methods. ... University of Leicester, Leicester, LE1 7RH, UK ...
    (comp.lang.java.help)
  • Re: io: how many imgs in images folder?
    ... Use the listor listFilesmethods of a File object ... Also note that listand listFiles() are overloaded methods. ... University of Leicester, Leicester, LE1 7RH, UK ...
    (comp.lang.java.help)
  • Re: io: how many imgs in images folder?
    ... Use the listor listFilesmethods of a File object ... representing the directory. ... Also note that listand listFiles() are overloaded methods. ...
    (comp.lang.java.help)