We are getting properties (that we can not influence) out of a database and want to access them by a key/value mapping.
We are facing the problem that one of the property keys includes a blank character.
foo bar = barefoot
This is - correctly - interpreted as follows
key: foo
value: bar = barefoot
Is there a way to include the blank in the key so that it's not interpreted as the delimiter? I guess this behaviour is just like intended, but I thought I could give it a try here.
解决方案
As it seems the delimiter should be =, not space.
Hence - keyValuePair.split("=") should do.
If you are loading this from a java .properties file, then you can extend java.util.Properties and override this method
public synchronized void load(InputStream inStream) throws IOException
so that it parses the properties correctly.