Results 1 to 3 of 3
  1. #1
    X-ion is offline Member
    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    0

    Default Get all files in a project

    Hi,

    does anybody know how i can access all files within a project? Just go through all folders and all files codewise, and read them in a buffer or something, i just need the looping.

    Also if have an IResourceDelta how is it possible to only get the files with the complete name that have changed and not also packages? when you have this project setup:

    foo
    foo.bar
    foo.bar.foobar
    -test.java

    And you change the test.java the visit function of IResourceDelta gives back that foo changed, foo.bar, foo.bar.foobar and foo.bar.foobar.test.java changed. I only want to get the last one,

    Thanks in advance

  2. #2
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    364
    Rep Power
    5

    Default

    Use SEARCH to find what you need on forum,
    those are very common questions.

    One of seacrh results:

    can java.io.File create a list of all files and folders.

    go ahead and find many others

    cheers!

  3. #3
    X-ion is offline Member
    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    0

    Default

    Hi Fon,

    I think its better to forget my first post, since it only relates to the real problem.

    Once ive found all the files in the project i want to search through the files for certain patterns and then send back the filename and the linenumber where the pattern is found so i can place a marker (Yes its about plugins), thats why i also asked about the IResourceDelta.

    Anyway what is the best way to search through files and find certain patterns. I want for example find an @SpaceId annotation that is used on a setter. So once more...

    1) go through all files (Or all editted files in case of an incremental build (you get the deltaResource thing back with the changes to the project)
    2) Search for a pattern containing all setters on which the annotation @SpaceId has been set,
    3) Create a marker on that place (so i need the linenumber and the IFile )

    I'm hoping this can be done easily, but i expect to do some reflection...

    Greetz Michiel
    Last edited by X-ion; 02-24-2010 at 02:53 PM.

Similar Threads

  1. Project containing multiple source files
    By mr smiley in forum Eclipse
    Replies: 0
    Last Post: 04-25-2009, 10:31 PM
  2. files in project after creating jar
    By pgag45 in forum New To Java
    Replies: 4
    Last Post: 04-19-2009, 04:06 AM
  3. Adding property or config files to a project
    By anacapa in forum Eclipse
    Replies: 3
    Last Post: 02-03-2009, 07:34 PM
  4. Replies: 4
    Last Post: 01-14-2009, 04:12 AM
  5. DOAP files (description of a project)
    By turtleboy in forum XML
    Replies: 0
    Last Post: 11-05-2008, 01:54 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
  •