Thoughts on system properties for startup
Tom Zeller
tzeller at dragonacea.biz
Wed Jun 18 16:43:03 EDT 2014
>>I spent some time revisiting IDP-352, which boils down to working
>>around the string comparison that Web Flow uses to map XML flow
>>definitions on the file system to flow IDs. For Windows, I think one
>>function of the app ctx initializer will need to be the population of
>>an idp.home.normalized property which is idp.home with backslashes
>>replaced with forwardslashes.
>
> I think you end up there if you set idp.home to a path, but can't prefix
> the uses of idp.home with an extra slash. I'd rather avoid that by setting
> the necessary properties in idp.properties that handle the cases that
> aren't working. If we need idp.webflow.base=file:///${idp.home}/conf I'd
> rather just do that.
I don't think the "file:///" scheme prefix helps.
> I think adding normalization gets into situations where we try and use a
> normalized property, find reasons that doesn't work, and then have to
> define more of them for different buggy code. I'd rather just call them
> what they are, new properties targeted at specific needs.
I think I am in agreement with you, the purpose of
${idp.home.normalized} is just for the userFlowRegistry base-path,
that's it. Maybe it should be renamed {$idp.home.webFlow.basePath} if
that helps. The reason for that specific property is for string
comparison of the "file path" to the "base path" when mapping flow IDs
to flow definition file paths. The "file path" is returned by
Resource.getPath(), and both the URLResource and FileSytemResource
call StringUtils.cleanPath() [1] which converts Windows separators "\"
to slashes "/". Consequently, the "base path" must also convert "\" to
"/". So, call it what we want, but I think we need to do the
conversion of the "base path".
This is what the testbed was doing anyway, in
PathPropertySupport.normalizePath() :
String normalized = path.replace("\\", "/");
[1] http://docs.spring.io/spring/docs/4.0.x/javadoc-api/org/springframework/util/StringUtils.html
More information about the dev
mailing list