Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Simple java search

Options
  • 14-04-2005 3:54pm
    #1
    Closed Accounts Posts: 43


    Can anyone tell me how to do a simple java search of a disk? Im trying to get it to look for some folders on the drive, like the desktop folder, but I dont want to hard code the path name in. I would like it to be able to look for the folder name itself. If anyone could help me out in this respect.


Comments

  • Registered Users Posts: 2,426 ✭✭✭ressem


    Jakarta commons class suit you?
    org.apache.commons.io.find.FileFinder

    http://jakarta.apache.org/commons/io/apidocs/index.html


  • Registered Users Posts: 2,426 ✭✭✭ressem


    Afterthought: guessing that you're building a user app, you might want to consider the possibility that the a user might have access to multiple user folders called called Desktop, so you might want to look at

    javax.swing.filechooser.FileSystemView
    getHomeDirectory() and getDefaultDirectory()

    which make use of the windows settings


Advertisement