posted 18 years ago
I'd like to use an absolute file path, but don't seem able to do so.
I should mention this is a stand-alone J2SE program, no Web-Container.
Anyone know a way to do this? I'm trying to use the following FileSystemXMLApplicationContext which seems to only allow relative file paths. Perhaps, I'm fairly new to Spring so perhaps there is an alternate way I've overlooked.
If I pass in "/user/appRoot/properties/projectX/projectX.xml", Spring will only look for it as a relative path off the current directory the program was launched from. So it prepends the current directory as in "/user/appRoot/scripts/user/appRoot/properties/projectX/projectX.xml" and causes an IOException. A relative path will work. As in "../properties/projectX/projectX.xml", but this isn't what I want to do.
I'd say that's fine if I had said "user/appRoot/properties/projectX/projectX.xml" but the '/' in front should indicate an absolute path, should it not?
I'm not against a relative path. If you put your configuration file in the same directory as the script that launches your application that's a beautiful thing. I just wish it had the flexibility to do both absolute and relative paths.