Results 1 to 7 of 7
  1. #1
    chizbox is offline Member
    Join Date
    Feb 2010
    Location
    Philippines
    Posts
    20
    Rep Power
    0

    Default Folder Update Detection

    Hi guys!

    I need your help, i have been researching for a code wherein a java
    program can detect any changes that has been made for a specific
    folder or directory.

    for example a new file is added in the directory the java program will
    e-mail me that i have a new folder inside my directory.

    can any body help me with this?

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    A loop that checks the directory every once in a while.

    See the API docs for File.

  3. #3
    chizbox is offline Member
    Join Date
    Feb 2010
    Location
    Philippines
    Posts
    20
    Rep Power
    0

    Default

    how very specific! haha! im just joking. ill try to search first on the API. although it would be better if you share your ideas.

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    What is missing there? Keep the array that one of File's methods gives you and compare it to the array that that same method gives you the next time you call it.

  5. #5
    chizbox is offline Member
    Join Date
    Feb 2010
    Location
    Philippines
    Posts
    20
    Rep Power
    0

    Default

    so how do i implement it if i want it to run recursively?

  6. #6
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Edit:

    A List of Lists and a method that can be called recursively as you traverse directory depth.

  7. #7
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    You would probably be better off, however, with a list of directory paths and an array per directory (probably a Map<File, File[]> would be best).

Similar Threads

  1. Key Detection
    By dilpreet28 in forum Java Applets
    Replies: 11
    Last Post: 06-17-2010, 02:38 AM
  2. Collision Detection
    By dotabyss in forum Java Gaming
    Replies: 0
    Last Post: 03-14-2010, 06:13 PM
  3. help on motion detection
    By MarkWilson in forum Advanced Java
    Replies: 4
    Last Post: 12-07-2009, 06:45 AM
  4. request detection
    By mtyoung in forum Advanced Java
    Replies: 6
    Last Post: 02-05-2009, 03:46 AM
  5. USB Detection
    By alanixu in forum New To Java
    Replies: 3
    Last Post: 11-12-2008, 04:04 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
  •