Adding file names to an array list in java

Posted by Chris G on Stack Overflow See other posts from Stack Overflow or by Chris G
Published on 2010-03-28T12:58:16Z Indexed on 2010/03/28 13:03 UTC
Read the original article Hit count: 189

Filed under:
|

Hi

I am currently needing to load the contents of a folders filenames to an arraylist I have but I am unsure as how to do this.

To put it into perspective I have a folder with One.txt, Two.txt, Three.txt etc. I want to be able to load this list into an arraylist so that if I was to check the arraylist its contents would be :

arraylist[0] = One

arraylist[1] = Two

arraylist[3] = Three

If anyone could give me any insight into this it would be much appreciated.

© Stack Overflow or respective owner

Related posts about java

Related posts about file