Now this could use a test. :) Probably better to make this a function, for testability (so you can stub System/getProperty or something?).