Skip to content
Advertisement

Tag: configuration

Java: possible to line break in a properties file?

Is it possible to continue a long string on the next line in a Java properties file? e.g., somehow and when I get getProperty(“myStr”) it will return with “Hello World”? Answer A backslash at the end of a line lets you break across multiple lines, and whitespace that starts a line is ignored: Note: the backslash needs to be at

What is the proper way to store app’s conf data in Java?

Where do you store user-specific and machine-specific runtime configuration data for J2SE application? (For example, C:UsersUSERNAMEAppDataRoaming</em> on Windows and /home/username on Unix) How do you get these locations in the filesystem in platform-independent way? Answer That depends on your kind of J2SE Application: J2SE executable JAR file (very simple): use user.home System property to find home-dir. Then make a subdir

Advertisement