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

Filer.createResource ignores relative directory without explicit -d option

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: core-libs

      Description

      It has been reported that Filer.createResource will ignore the relative directory unless an explicit -d option is used:

      http://forum.java.sun.com/thread.jspa?threadID=5240999

      My annotation processor tries to create an output file called META-INF/persistence.xml in the classes output directory (i.e. -d option to javac). So, I wrote following code:

      final FileObject fo = processingEnv.getFiler().createResource(
      StandardLocation.CLASS_OUTPUT, // -d option to javac
      "",
      "META-INF/persistence.xml",
      null);


      This works as long as I pass -d option to javac. e.g., if I invoke:
      javac -d . Foo.java
      it creates ./META-INF/persistence.xml. But, if I invoke
      javac Foo.java
      it creates ./persistence.xml; where is my META-INF directory gone?

      Sahoo

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                darcy Joe Darcy
                Reporter:
                darcy Joe Darcy
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: