Is there any way of specifying the current directory in a java properties file?
i.e. something like:
fileLocation={currentDir}/fileName.txt
In Java, we can use System. getProperty("user. dir") to get the current working directory, the directory from where your program was launched.
properties is a file extension for files mainly used in Java-related technologies to store the configurable parameters of an application. They can also be used for storing strings for Internationalization and localization; these are known as Property Resource Bundles.
No. Properties files do not have any builtin macro facilities. You can programmatically get the currect directory of the user running the Java app through the user.dir system property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With