how to use java command to help me search file in directory by directory ?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: how to use java command to help me search file in directory by directory ?

  1. #1
    koonlee Guest

    how to use java command to help me search file in directory by directory ?


    i am currently doing a project related about searching file/file extension
    in a computer with the java script.
    the things like this , user just key in the filename or extension file like
    *.txt, and the program will help user search whole directory in computer

    and display all the file that related and also the path of directory.
    so if i key in *.java, the it will show me all the place /directory where
    have this kind of file.
    example:
    c:/javafolder/testing.java
    c:/javafolder/folder2/line.java
    c:/other/one.java

    i am thinking(sorry if i am wrong) using java.awt and setDirectory() or
    getDirectory()or searchDirectory(0 to search the location.any idea that other
    command will help me ?
    or have any experience related with my project that can share some simple
    command with me ? or do
    u have any rellated site that can offer the full command line with the
    example and explaination ?
    i have try to search some website but a ot of they only give me the keywords
    like getDirectory() and too simple explaain and i am not quiet understand
    how to use it .

    thanks


  2. #2
    Rajkamal Gopinath Guest

    Re: how to use java command to help me search file in directory by directory ?


    Hi,

    Use java.io.File to represent directories and use list() method of the same
    to access the names of files & sub directories and continue that for for
    every sub directory. you have lots of methods inside File class to do what
    ever you want for File Management stuff...

    Regards

    Rajkamal


    "koonlee" <nkl787@mailcity.com> wrote:
    >
    >i am currently doing a project related about searching file/file extension
    > in a computer with the java script.
    >the things like this , user just key in the filename or extension file like
    > *.txt, and the program will help user search whole directory in computer
    >
    >and display all the file that related and also the path of directory.
    >so if i key in *.java, the it will show me all the place /directory where
    >have this kind of file.
    >example:
    >c:/javafolder/testing.java
    >c:/javafolder/folder2/line.java
    >c:/other/one.java
    >
    >i am thinking(sorry if i am wrong) using java.awt and setDirectory() or


    >getDirectory()or searchDirectory(0 to search the location.any idea that

    other
    >command will help me ?
    >or have any experience related with my project that can share some simple
    >command with me ? or do
    >u have any rellated site that can offer the full command line with the


    >example and explaination ?
    >i have try to search some website but a ot of they only give me the keywords
    > like getDirectory() and too simple explaain and i am not quiet understand
    > how to use it .
    >
    >thanks
    >



  3. #3
    Join Date
    Sep 2005
    Location
    india
    Posts
    5

    Question help needed

    hello
    i am undergoin a project on system search using Java. since your project seems similar to mine i would like u to help me out with this. especially with the search of directories and files in the system. wai8tin for ur reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center