Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Fubarable

Thread: Java searcher program CHALLANGE

  1. #1
    searcher is offline Member
    Join Date
    Jan 2012
    Rep Power

    Question Java searcher program CHALLANGE

    create an application, searcher that takes two command line arguments: the starting directory and the target to find.

    Searcher makes use of a recursive algorithm with the method signature: public static void scan (String path). This recursive algorithm needs to scan through directories and over file names in order to locate the specified file from the command line. You will, in all likelihood, need to make your FileIOHelper class described below. once you located your file you can stop executing and display the output of where the file was located.

    Create a class called FileIOHelper. This has two private String arrays, directories and files. It also includes two public instance int variables dirLength and fileLength witch stores length of directories and files String arrays respectively.

    it has one constructor that takes a file object, witch is used to determine the directory where you are going to be getting the information from. the constructor needs to iterate through each array element provided and assign the String to the right array(it's either a dir or file). Your arrays need to resize properly as you iterate through them.

    The fileIOHelper has two public methods, getDirectories() and getFiles() both return their respective protected String arrays.

    The FileIOHelper also has 2 private methods addToFile() and addToDirectory() witch both take a String and return a String array

    1)keeping track of witch stack your working on currently - loggin information to a file through a static logger class.
    2)using assertions where posible.

    Came across it some weeks ago and thought it was a fun project to tackle and thought i'd share it whould like to compare my work to others.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

    Default Re: Java searcher program CHALLANGE

    This looks like a nice project and I think that I speak for all in wishing much luck in successfully completing it and getting a decent grade from it.
    quad64bit likes this.

Similar Threads

  1. execute java program within java program
    By popey in forum New To Java
    Replies: 2
    Last Post: 10-22-2009, 05:32 PM
  2. homework help/ String Searcher
    By safecracker in forum New To Java
    Replies: 8
    Last Post: 12-04-2008, 05:41 AM
  3. Regular Expression Challange
    By hiklior in forum New To Java
    Replies: 2
    Last Post: 04-24-2008, 05:05 AM
  4. Replies: 0
    Last Post: 04-04-2008, 02:40 PM
  5. Replies: 0
    Last Post: 10-04-2007, 09:33 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