Spring - factory method for Path

factory, factory-method, java, spring

Solution

java.nio.file.Paths.get expects URI. Besides, this is xml not java don't use \\

Try as

file:/C:/tmp/

If you have problems with URI syntax visit http://en.wikipedia.org/wiki/File_url

Problem

I am trying to generate a bean that would represent `java.nio.file.Path` using a static method `Paths.get(String path)`. my current Spring setup looks as follows: ``` <bean id="myPath" class="java.nio.file.Paths" factory-method="get"> <constructor-arg value="c:\\tmp\\" /> </bean> ``` but it comes back with an excpetion `No matching factory method found: factory method 'get'`. Any ideas why that is the case?

Original source