How to get current directory in Spring?

directory, java, spring, string

Solution

Java cannot determine the root of your project without projects meta data. You can get the absolute path to your current class executing the code using the following : YourClassName.class.getResource("").getPath()

Problem

I've got a little project in Spring. It's located (for example) in `C:/users/projects/blog`. How can I get this path?

Original source

Related problems