Get absolute path to project directory in application.properties

Viewed 858

I am writing a Quarkus application which reads data over http. In my application.properties file, I have this line:

my.resource=http://path/to/file

Every time I run the app, it has to download the file so I created a smaller version of the file locally for developing purpose. The problem is that I don't know how to put it in the properties file.

Ideally, I want something like this:

my.resource=http://path/to/file
%dev.my.resource=file://${project-dir}/sample_data/file

And I have to use the absolute path because I used new URI(resource).toURL() method which requires an absolute URI.

Thanks in advance.

1 Answers

Application properties is something that is used when your application is deployed to adopt your application to the target environment, does the user of the deployed application know anything about project directory? Project directory is something that makes sense when you are developing your application. having said that using project directory in that file does not make sense at all.

Related