We have a property file that list certain directory info.
Ex.
com.xxx.install = c:\windows\whatever
But when we do a load using java.util.Properties the property comes up as
com.xxx.install = c:windowswhatever
How can we get java to not drop the '\'s.
> We have a property file that list certain directory info.
>
[quoted text clipped - 5 lines]
>
> How can we get java to not drop the '\'s.
Escape them or use (forward)slashes.
>com.xxx.install = c:\windows\whatever
>
>But when we do a load using java.util.Properties the property comes up as
>com.xxx.install = c:windowswhatever
>
>How can we get java to not drop the '\'s.
the easiest way is to use / instead. There is never any need to
fiddle with \ in windows, unless you are displaying filenames to the
user.
See http://mindprod.com/jgloss/properties.html for the quoting
conventions of Properties files if you want to embed \.
If these seem too onerous, roll you own or use the MultiProperties
class part of the Replicator. see
http://mindprod.com/products1.html#REPLICATOR

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.