Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6471017

Filer need to provide random access to files

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 6
    • tools
    • apt
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      The annotation processor at the moment provides a very limited way to interact with files, as encapsulted by the Filer interface:

      http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/

      Unfortunately, this makes it difficult to maintain some files over incremental bulids.

      JUSTIFICATION :
      For example, I am using annotations to build a list of services that are placed in my jar's META_INF/services directory. I want a file in that directory to contain a list of every class that implements a particular annotaiton. Unfortunately, every time I recompile and only some source files with the annotaion have been modified, only those class files will be read and the list will be replaced with this truncated list. I can only be sure thta my list is complete if I clean my class files and build the entire project.

      It would be helpful for me to be able to read this text file before overwriting it so I can see what entries already exist in it. Then I can simply copy across the old entries and append the new ones, instead of loosing all the old information in the file.

            darcy Joe Darcy
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: