How can I get the working directory of a project from an Annotation Processor in Java

I am writing an annotation processor in Java and in this annotation processor I want to be able to find a file in the Project hierarchy of the project on which I am using this annotation processor. Through the annotation I can pass in the path of the file I am searching for relative to the project root but i cannot retrieve the project's working directory.
Let's say that the processor is MyCustomProcessor and I am using it on the project MyProject. I want to be able to access(read) a file (a properties file) from the project structure of MyProject from the "process" method of MyCustomProcessor.
I have read this link Eclipse - Annotation processor, get project path but when I use their solution I get a null returned from the StandardJavaFileManager.getLocation(StandardLocation.SOURCE_PATH) call.
Some more details regarding the implementation:
MyAnnotationProcessor:
@SupportedAnnotationTypes(value = {"MyAnnotation" })
@SupportedSourceVersion(RELEASE_6)
public class MyCustomProcessor extends AbstractProcessor {
@Override public boolean process(final Set<? extends TypeElement> annotations, final RoundEnvironment roundEnv) {
for (final Element element : roundEnv.getElementsAnnotatedWith(MyAnnotation.class)) {
<!-- Here is where I would like to get the working directory !-->
More details about the testing and development environment: Eclipse Kepler, JRE 1.7.
If you need more details just ask.

There is an identical post with an answer located at this link.

Similar Messages

  • How can I get the remote directory from an FTPActivationSpec header?

    The header message generated for the oracle.tip.adapter.ftp.inbound.FTPActivationSpec contains the file name, FTP host and FTP port. Is there any way of getting the remote directory as well?
    <schema attributeFormDefault="qualified" elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/ftp/"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:FTPAPP="http://xmlns.oracle.com/pcbpel/adapter/ftp/">
    <element name="InboundFTPHeaderType">
    <complexType>
    <sequence>
    <element name="fileName" type="string"/>
    <element name="ftpHost" type="string"/>
    <element name="ftpPort" type="string"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    This is already specified in the activation spec parameters:
    <activationAgents>
    <activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent" partnerLink="ReadFileService">
    <property name="ftpRemoteDir" type="LogicalDirectory">out</property>
    <property name="portType">Read_ptt</property>
    </activationAgent>
    </activationAgents>
    But I don't want to have to add a separate preference parameter to hold the same thing if I don't have to. Alternatively, is there any way of querying the activation agent parameters from within an xpath expression, similar to "ora:getPreference()"?
    Cheers,

    add:
    <element name="directory" type="string"/>
    to the FTP adapter header WSDL

  • How can I get the Fireworks pen tool to disengage from an open path shape (and stay disengaged)!

    I am so frustrated! I can't get the fireworks pen tool to disengage when I am finished creating an open path shape (double clicking the end-point isn't working).  The only way I can disengage the pen tool  is to click on a different tool, BUT ...if I do that (i.e., click on a different tool), and then go back to the pen tool (with the intent to create another open path shape), the pen tool automatically engages the last point of my prior open path shape ... and ... no matter what I do, I can't get the pen tool in Fireworks to stop doing this with my open path shapes.
    If anyone has any helpful advice, it would be much appreciated!
    Thank you!
    (note: I prefer not to have to go back and forth creating open path shapes in Illustrator then bring them into Fireworks, but if all else fails, I suppose I'll have to as a work-around.)

    Have you tried holding the Command key and clicking away from the last point? The Command (⌘) key will bring up the Subselection tool; clicking on the canvas with it will allow you to disengage from the path. Once you release the key, the Pen tool will return and you can begin another path.

  • How can I get the value of a custom property from a resource object?

    I am trying to get the value(s) of a custom property, called "status" within a method. The method has an object of type IResource available to it.
    I have tried the following:
    PropertyName propName = new PropertyName("","status");
    value = res.getProperty(propName).toString();
    However, I am getting a NullPointerException when I try to create the PropertyName instance.
    Is there a better way to get the value of a specific property from a resource object?
    Thanks,
      Tom

    Thanks Praveen.
    I was missing the default namespace of "http://sapportals.com/xmlns/cm" - I thought I could just pass an empty string for the namespace, but it looks like I must always specifiy, even if it is default.
    Tom

  • How can I get  the iPhone Calendar to update reminders from Outlook?

    I have an iPhone 2g v2.0.2 with an Exchange account through work. Everything works flawlessly except one annoying problem: The iPhone calendar does not seem to recognize that I have dismissed or changed a reminder time in Outlook.
    Example: A reminder alert appears on my computer (Windows XP/Outlook 2007/Kerio mail server). I will "Dismiss" the alert only to have it pop up again 10 seconds later presumably because my iPhone didn't get the dismissed reminder message, then syncs back to Outlook that the reminder is still active. I have even opened the item in Outlook, changed or canceled the reminder, saved the item, only to have it pop up again seconds later after the iphone reverts to the original reminder.
    The only way I have found to stop this cycle is to open the item on the iPhone calendar and cancel the reminder.
    Any ideas on how to solve this would be appreciated.
    thanks

    Just so that you know you're not alone, I have a couple clients experiencing the same problem. Have yet to come up with a solution outside of what you've mentioned. Wish I had more to add to the topic.

  • How can i get the last delete picture's info from tlf?

    if i delete the picture from the tlf i can't make the tlf undo
    and I want to get the picture'info with I last time delete from tlf 

    Can you let us know what you are doing to delete the picture, and also how you are undoing it? If it is being deleted through the EditManager delete function, the delete should undo correctly. Some example code to illustrate the problem would help.
    Once the picture has been deleted, TLF has no further reference to it. If you want to keep a reference, you will have to get it before it has been deleted. If you don't have control over the delete, you could find out when the image is deleted by listening for FLOW_OPERATION_END events.
    - robin

  • I used a trial version of Adobe Muse and worked on my new site, however travelled and the subscription expired.  How can i get the work i did back???? i spent hours and hours on designing my page.

    EXPIRED TRIAL....................trying to recover work created on MUSE TRIAL.... I will purchase the program however i want to recover work i created.

    Any work you created and saved will be on your computer. Of course, if you don't purchase the program, you can't work on what you saved.

  • How can i get the address with drag and drop from address book into pages?

    I want to creat a letter withe the new pages. Normaly it was possible to put the adress from the adressbook with drag and drop into the letter. So it was possible to create one letter with many different adresses. But now I didn't find this function any more. How to do ist now?
    Withe best regards and I'm sorry for may bad english
    Klaus

    Sounds like you "upgraded" to Pages 5.
    Apple has removed over 90 features from Pages 5.
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5, after Exporting your files to Pages '09, and rate/review it in the App Store, then get back to work.
    Peter

  • How can I change the title backgrounds in a project from a converted movie trailer theme?

    I converted a movie trailer theme (action) to a movie. The title backgrounds are all red but I like the effects. I would like the background color to be blue. Thanks for your help!

    Unfortunately I tried doing a swap with a color background and it looks like it doesn't let you just drag a replacement background in. So the best you can expect is to drag a color background from the Map tool browser (it has a globe icon on it) and drag it next to the background you want to use, set the duration to be the same length. Drag the tite block to the new color background clip. Then delete the background from the original Movie trailer version.

  • How can i get the music ive copied from cd onto my new computer

       how can i get the music that i have copied from cd's on to my new computer.(the computer my phone was sync to blew up)  if i sync to the newit i will all the music  thats on my phone, 

    Restore from the backup of your old computer. Copy it from the CDs.
    Look for a 3rd party app that can do what you want. Senuti has been
    mentioned in the past - I do not use it so cannot comment on how
    well it works. I would assume there are others as well.
    iOS does not natively support syncing music back from the iPhone
    to a computer.

  • How can I get the chapter numbering in automatic directory

    How can I get the new pages to take over the chapter numbering in automatic directory.

    Hi Peter,
    thank you for the quick answer.
    I'm new in the community therefor I have a additional question is there somebody reading who will take this as an feature for further updates of pages?
    I think this is a"must" for professionell work.
    Marcus

  • How can I get the iCloud/iTunes password for my (now) deceased Father-in-Law's Imac?  I have a list of his passwords, but nothing works!

    How can I get the iCloud/iTunes password for my (now) deceased Father-in-Law's iMac?  I have a list of his passwords, but nothing works!  I know his email, but that account has been cancelled for security purposes, so we can't just request a new one.  I tried his security questions to no avail.
    Thanks

    Since that password is tied to his Apple ID, you will need to contact Apple; as far as I know, it will be a somewhat lengthy procedure and you will  need to furnish necessary paperwork (including a death certificate as far as I know). Best to either stop at an Apple store or call them to find out exactly what it is you need to do.

  • How can I get the 23 July update to load onto my iPad. I haven't been able to access my documents or work for weeks and need to use it. Has anyone else had similar problems?

    How can I get the 23 July update to load onto my iPad. I haven't been able to access my documents or work for weeks and need to use it. Has anyone else had similar problems?

    Hello Arthur,
    Thank you for the reply.
    You were correct that deleting the app and reinstalling it was the only thing to make it work but unfortunately I lost all the documents I made, even though they were backed up to iCloud before i deleted the app. At the same time as deleting pages I had to delete keynote and numbers too, so I've lost all the documents in them too.
    The mb of data which was assigned to each programme in iCloud has reduced, so. I guess they are gone for good. Is there any other way to reaccess them?
    Not your fault but I am a bit fed up the the iPad. I have lost work that I've done and have no other copy apart from what was in iCloud, as I don't have a printer and couldn't email them too myself as I couldn't get into the programme and  i've also got episodes of tv series I purchased that I can't download and albums that are half downloaded with songs missing, so I feel a bit swindled out of time and money and am going back to DVD ,  pen and paper and CDs .
    Instead of using iCloud I guess the only way to make sure I don't loose any more documents it to email them to myself each time I save them on the iPad. Is there anything else you could suggest please?
    I don't have any other apple products apart from iPods, so I can't access the iCloud on anything else can I?
    Thanks
    Amanda

  • How can I get the iBook app on my Mac to backup ePubs I created with Pages on my iPad? Only seems to want to work with purchased from the ibook store.

    How can I get the iBook app on my Mac to backup ePubs I created with Pages on my iPad? Only seems to want to work with purchased books from the ibook store. The problem is, once I create a document in Pages and turn it into an ePub to be opened in iBooks, I delete the document in Pages, because I don't need two copies taking up space on my iPad. Before Maverick, iTunes would backup everything in my iBook app on my iPad. If something ever happened to my iPad, all of my created ePubs would be lost and I would be screwed. I suppose I could keep everything on Pages and go to iCloud and download my documents to my Mac, but that is a lot of steps. I may have to do that if there is no other way, but I am hoping someone will have the answer for me. Pretty disappointed in iBooks app for Mac at this point.

    iBooks only syncs purchased books. Others must be synced in iTunes.

  • Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

    Whenever I update my iPhone software, it asks me to sign in to iCloud with an old email address.  My other devices all have the correct address.  How can I get the correct address for my iPhone?  The only Apple ID that works for logging in is my new one.

    To change the iCloud ID you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iPhone (if you're using iOS 7), then sign back in with the ID you wish to use.  If you don't know the password for your old ID, or if it isn't accepted, go to https//appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Tap edit next to the primary email account, tap Edit, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iPhone on your device, even though it prompts you for the password for your old account ID. Then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https//appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

Maybe you are looking for

  • The macbook pro keyboard media buttons doesn't work for itunes

    hi, since i installed the snow leopard the buttons doesn't control (play, stop, forward...) the itunes.

  • GRE/Legal Entity not migrated in R12

    LE not migrated into R12 We are upgrading from 11.5.9.2 with OPM to R12.0.4, after upgrade, LE not migrated Question arise is At 11i, For Legal Entity, Is it necessary to attach Classification of HR Organization. Existing is GRE/Legal Entity Only.

  • 9.3.1.3 Installation

    Hi Guys, I downloaded a bunch of the 9.3.1.3 packages but noticed that my extraction order must be wrong because when running setup.exe there was only provider services: 1_Shared_Services_9_3_1_V11229-01.zip 2_Essbase_Server_9_3_1_3_V14762-01.zip 3_E

  • Selecting from two tables

    I have two tables: TABLE: users (user_is is primary key): ++++++++++++++++++++++++++++++++++++++ user_id     | username 1     | fazle 2     | newaz 3     | shaerul 4     | badsha 5     | mirmohsin 6     | mdmohsin 7     | shawkat 8     | ahsan 9     

  • Not able to adjust screen brightness in Windows 8.1

    hi, I m using HP Pavillion N208TX with windows 8.1 64 bit version. i m not able to adjust screen brightness from f2 and f3 button and from the power setting also. when i press these buttons it shows the slider to adjust the brightness on top left cor