Results 1 to 3 of 3
  1. #1
    mary is offline Member
    Join Date
    Jul 2007
    Posts
    51
    Rep Power
    0

    Default how to get the names of the files

    How can I get the names of the files?
    For example If I have this directory:
    Java Code:
    C:\DocumentsAndSettings\yiyo
    invert.xls
    helloworld.java
    telephones.xls
    I need to get all the file names.

    how can I do that?

  2. #2
    brianhks is offline Senior Member
    Join Date
    Jul 2007
    Posts
    135
    Rep Power
    0

    Default

    java.io.File.list() is what you are looking for. Create a File set to your directory and then call list().

  3. #3
    mary is offline Member
    Join Date
    Jul 2007
    Posts
    51
    Rep Power
    0

Similar Threads

  1. Names pipes in java
    By Zept in forum Networking
    Replies: 2
    Last Post: 08-06-2011, 08:20 PM
  2. Getting method names using Reflection
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-24-2008, 03:18 PM
  3. Drive names
    By alwz_nikhil in forum New To Java
    Replies: 0
    Last Post: 11-28-2007, 10:04 AM
  4. Adding file names(Help!!)
    By Gambit17 in forum New To Java
    Replies: 4
    Last Post: 11-09-2007, 07:26 AM
  5. how can I get the names of variables in runtime?
    By tommy in forum New To Java
    Replies: 1
    Last Post: 07-27-2007, 10:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •