find file by mask

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • slukacs

    find file by mask

    hello one and all,

    still new to java, day 12 now, but liking a bit more each day. how
    would i do this in java.

    say i want to see of the files of type "*.zip" in or under the directory
    "/home/lucas". or, i want to see the file names of those with the
    extension "zip" along with either their respective full or relative
    paths to each of those files under that directory "/home/lucas".

    what is the best method to do this in java? please provide a code
    snippet as an example. thank you in advance and have a great easter
    weekend.

    lucas

  • Glenn

    #2
    Re: find file by mask

    One way to do this is to use a java.io.Filenam eFilter. The java.io
    package offers many ways to interact with the file system. Real
    Gagnon has posted an example use of a FilenameFilter:

    Real's HowTo : Useful code snippets for Java, JS, PB and more


    Real has a lot of great coding examples on his site:

    Real's HowTo : Useful code snippets for Java, JS, PB and more


    HTH


    - Glenn


    slukacs <slukacs@adelph ia.net> wrote in message news:<mrudnRYIi 8WKS-vd4p2dnA@adelph ia.com>...[color=blue]
    > hello one and all,
    >
    > still new to java, day 12 now, but liking a bit more each day. how
    > would i do this in java.
    >
    > say i want to see of the files of type "*.zip" in or under the directory
    > "/home/lucas". or, i want to see the file names of those with the
    > extension "zip" along with either their respective full or relative
    > paths to each of those files under that directory "/home/lucas".
    >
    > what is the best method to do this in java? please provide a code
    > snippet as an example. thank you in advance and have a great easter
    > weekend.
    >
    > lucas[/color]

    Comment

    Working...