Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

java property files and the \

Thread view: 
Arinté - 24 Mar 2006 16:42 GMT
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.
Boris Gorjan - 24 Mar 2006 17:12 GMT
> 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.
Roedy Green - 24 Mar 2006 19:36 GMT
>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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.