1 Reply Latest reply: Feb 10, 2013 6:15 PM by EJP RSS

    Reading META-INF contents from an annotation processor


      I'm trying to read the contents of META-INF with my annotation processor, something akin to:
      public boolean process(
      Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
      try {
      FileObject resource = processingEnv.getFiler().getResource(
      StandardLocation.SOURCE_PATH, "META-INF.services", "javax.annotation.processing.Processor");
      String filecontents = new Scanner(resource.openInputStream()).useDelimiter("\\A").next();
      processingEnv.getMessager().printMessage(Kind.NOTE, filecontents);
      } catch (IOException ex) {
      processingEnv.getMessager().printMessage(Kind.ERROR, ex.toString());
      return true;

      (But against something that is relevant for my processor.) But when I do that I get:
      error: javax.annotation.processing.FilerException: Illegal name META-INF.services

      Bug, or shouldn't annotation processors be reading the contents of META-INF anyhow?

      Thor Michael