<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to load resources in IvyProject from Java?</title><link>https://answers.axonivy.com/questions/2872/how-to-load-resources-in-ivyproject-from-java</link><description>&lt;p&gt;In typical Java EE maven project I put resources in src/main/resources and access files with getResourceAsStream().&lt;/p&gt;
&lt;p&gt;How to work relative to the current class has been dicussed in  &lt;a href="https://discourse.axonivy.io/t/how-to-read-file-in-resources-folder-or-webcontent-in-an-axon-ivy-project/135/2" title="this thread"&gt;this thread&lt;/a&gt;. However, I would need an absolute way to access resources.  &lt;/p&gt;
&lt;p&gt;Background of this question is that I would like to use &lt;a href="http://owner.aeonbits.org/" title="owner"&gt;owner&lt;/a&gt; config &lt;a href="http://owner.aeonbits.org/docs/loading-strategies/" title="with fallback"&gt;with fallback&lt;/a&gt; to a classpath property file.&lt;/p&gt;
&lt;p&gt;Thanks for help.&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2872/how-to-load-resources-in-ivyproject-from-java" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 20 Sep 2017 13:02:58 -0400</lastBuildDate><item><title>Answer by Lars Tuchel</title><link>https://answers.axonivy.com/questions/2872/how-to-load-resources-in-ivyproject-from-java/2874</link><description>&lt;p&gt;Hi Adam&lt;/p&gt;
&lt;p&gt;Create a new folder in your axonivy project, add the folder to your classpath (as shown below) and then make sure you path starts with a forward-slash (e.g. &lt;code&gt;/path/to/my/file.txt&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;img alt="alt text" src="https://answers.axonivy.com/upfiles/add_src.png"&gt;&lt;/p&gt;
&lt;p&gt;Also here's a sample project: &lt;a href="https://drive.google.com/file/d/0B3V8Sh7Fl7FXWHRxcEw2T29PdkU/view?usp=sharing"&gt;https://drive.google.com/file/d/0B3V8Sh7Fl7FXWHRxcEw2T29PdkU/view?usp=sharing&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers
Lars&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lars Tuchel</dc:creator><pubDate>Wed, 20 Sep 2017 13:02:58 -0400</pubDate><guid>https://answers.axonivy.com/questions/2872/how-to-load-resources-in-ivyproject-from-java/2874</guid></item></channel></rss>