It looks like the Properties.load() happily loads in binary garbage unless it finds an invalid \uxxxx escape character. Is there a way to be more strict? I just looked at the docs for the text format of properties files, and I’m confused how to tell if a .properties file is valid.
edit: where I’m coming from with this: I figured if I pointed my application a 10MB binary file, that it would reject it. The 10MB file did get rejected, but only because of the \uxxxx characters.
I guess I could create a filter on the input stream to limit at some “sane” amount like 1MB, and filter out any key/value pairs where the key doesn’t match an acceptable pattern. But I was hoping that it might have some minimal structure to reject grossly corrupted files.
Properties files are supposed to be a generic format. It is the application’s responsability to ensure that each individual property has a sane value.